"Error executing post installation script" during eJabberd 15.07 installation

After clean Debian 8.1 X64 install, trying to install eJabberd server based on this tutorial

https://docs.ejabberd.im/admin/guide/installation/#installing-ejabberd-wi...

At the end of installation, it pops error message

Error: Error running Post Install Script.
The installation may have not completed correctly

Then I opened log file:

...
Unpacking /opt/ejabberd-15.07/doc/guide.html
Executing final installation script
Error executing post installation script
/opt/ejabberd-15.07/bin/postinstall.sh
\useradd: user 'ejabberd' already exists
usermod: no changes
chown: cannot access ‘/opt/ejabberd-15.07/{database,conf,logs}’: No such file or directory
mkdir: cannot create directory ‘/opt/ejabberd-15.07/database/ejabberd@localhost’: Permission denied
./ejabberdctl: 140: cd: can't cd to /opt/ejabberd-15.07/database/ejabberd@localhost
mkdir: cannot create directory ‘/opt/ejabberd-15.07/database/ejabberd@localhost’: Permission denied
./ejabberdctl: 140: cd: can't cd to /opt/ejabberd-15.07/database/ejabberd@localhost
Creating Uninstaller
Creating uninstaller 25%
Creating uninstaller 50%
Creating uninstaller 75%
Creating uninstaller 100%
Installation completed

What am I doing wrong?

This bug is tracked in

Syndicate content