Package: ejabberd
Version: 18.12.1-2
Severity: normal

Dear Maintainer,

I have a problem trying yo backup ejabberd database.

I'm using ejabberd (18.12.1-2) with debian buster.

When I do (as root):

ejabberdctl backup /tmp/ejabberd.backup

I don't get any errors, but there is no /tmp/ejabberd.backup file neither.

journalctl show some lines related with apparmor, although they are supposed to ALLOW the operations:

------x8------x8------x8------x8
abr 20 12:57:03 xmppsrv1 audit[5875]: AVC apparmor="ALLOWED" operation="mknod" profile="/usr/sbin/ejabberdctl" name="/tmp/ejabberd.backup.BUPTMP" pid= abr 20 12:57:03 xmppsrv1 audit[5875]: AVC apparmor="ALLOWED" operation="open" profile="/usr/sbin/ejabberdctl" name="/tmp/ejabberd.backup.BUPTMP" pid=5 abr 20 12:57:03 xmppsrv1 audit[5875]: AVC apparmor="ALLOWED" operation="truncate" profile="/usr/sbin/ejabberdctl" name="/tmp/ejabberd.backup.BUPTMP" p abr 20 12:57:03 xmppsrv1 kernel: audit: type=1400 audit(1587380223.577:51): apparmor="ALLOWED" operation="mknod" profile="/usr/sbin/ejabberdctl" name= abr 20 12:57:03 xmppsrv1 kernel: audit: type=1400 audit(1587380223.577:52): apparmor="ALLOWED" operation="open" profile="/usr/sbin/ejabberdctl" name=" abr 20 12:57:03 xmppsrv1 kernel: audit: type=1400 audit(1587380223.577:53): apparmor="ALLOWED" operation="truncate" profile="/usr/sbin/ejabberdctl" na abr 20 12:57:03 xmppsrv1 audit[5875]: AVC apparmor="ALLOWED" operation="rename_src" profile="/usr/sbin/ejabberdctl" name="/tmp/ejabberd.backup.BUPTMP" abr 20 12:57:03 xmppsrv1 audit[5875]: AVC apparmor="ALLOWED" operation="rename_dest" profile="/usr/sbin/ejabberdctl" name="/tmp/ejabberd.backup" pid=5 abr 20 12:57:03 xmppsrv1 kernel: audit: type=1400 audit(1587380223.913:54): apparmor="ALLOWED" operation="rename_src" profile="/usr/sbin/ejabberdctl" abr 20 12:57:03 xmppsrv1 kernel: audit: type=1400 audit(1587380223.913:55): apparmor="ALLOWED" operation="rename_dest" profile="/usr/sbin/ejabberdctl"
------x8------x8------x8------x8

The fact is that there is no /tmp/ejabberd.backup file

According to /etc/apparmor.d/usr.sbin.ejabberdctl:
       /var/backups/                                   rw,
       /var/backups/ejabberd**                         rwlk,

So I tried:
ejabberdctl backup /var/backups/ejabberd.backup

and I get this error:
Can't store backup in "/var/backups/ejabberd.backup" at node ejabberd@localhost: {'EXIT', {error, {file_error, "/var/backups/ejabberd.backup.BUPTMP", eacces}}}

because /var/backups/ has 755 permissions and is owned by root:root.

I created a directory in /tmp, owned by ejabberd but it did not worked neither.


The only way I managed to make a backup was in /var/run/ejabberd (it is owned by ejabberd, and also with "rw" in /etc/apparmor.d/usr/sbin/ejabberdctl)

ejabberdctl backup /var/run/ejabberd/ejabberd.backup


The documentation (/usr/share/doc/ejabberd/README.Debian.gz says that backups are stored in /var/backups when ejabberd is upgraded or restored. I didn't check if this is working or is it also affected by this problem.


There is not (or at least I didn't find) a proper place to store backups.

I think it should be documented where to store backups, or have and specific directory for backups that works.

Regards and thank you.



-- System Information:
Debian Release: 10.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-8-amd64 (SMP w/1 CPU core)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8), LANGUAGE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ejabberd depends on:
ii  adduser                        3.118
ii  debconf [debconf-2.0]          1.5.71
ii  erlang-asn1                    1:21.2.6+dfsg-1
ii  erlang-base [erlang-abi-17.0]  1:21.2.6+dfsg-1
ii  erlang-base64url               1.0-3
ii  erlang-crypto                  1:21.2.6+dfsg-1
ii  erlang-goldrush                0.2.0-1
ii  erlang-inets                   1:21.2.6+dfsg-1
ii  erlang-jiffy                   0.14.11+dfsg-4
ii  erlang-jose                    1.9.0-1
ii  erlang-lager                   3.6.8-1
ii  erlang-mnesia                  1:21.2.6+dfsg-1
ii  erlang-odbc                    1:21.2.6+dfsg-1
ii  erlang-os-mon                  1:21.2.6+dfsg-1
ii  erlang-p1-cache-tab            1.0.17-1
ii  erlang-p1-eimp                 1.0.9-1
ii  erlang-p1-iconv                1.0.10-1
ii  erlang-p1-pkix                 1.0.0-3+deb10u1
ii  erlang-p1-stringprep           1.0.14-1
ii  erlang-p1-tls                  1.0.26-1
ii  erlang-p1-utils                1.0.13-1
ii  erlang-p1-xml                  1.1.34-1
ii  erlang-p1-xmpp                 1.2.8-1
ii  erlang-p1-yaml                 1.0.17-1
ii  erlang-p1-zlib                 1.0.4-3
ii  erlang-public-key              1:21.2.6+dfsg-1
ii  erlang-ssl                     1:21.2.6+dfsg-1
ii  erlang-syntax-tools            1:21.2.6+dfsg-1
ii  erlang-xmerl                   1:21.2.6+dfsg-1
ii  lsb-base                       10.2019051400
ii  openssl                        1.1.1d-0+deb10u2
ii  ucf                            3.0038+nmu1

ejabberd recommends no packages.

Versions of packages ejabberd suggests:
ii  apparmor             2.13.2-10
pn  apparmor-utils       <none>
pn  ejabberd-contrib     <none>
pn  erlang-luerl         <none>
pn  erlang-p1-mysql      <none>
pn  erlang-p1-oauth2     <none>
pn  erlang-p1-pam        <none>
pn  erlang-p1-pgsql      <none>
pn  erlang-p1-sip        <none>
pn  erlang-p1-sqlite3    <none>
pn  erlang-p1-stun       <none>
pn  erlang-redis-client  <none>
pn  imagemagick          <none>
pn  libunix-syslog-perl  <none>
pn  yamllint             <none>

-- Configuration Files:
/etc/ejabberd/inetrc [Errno 13] Permiso denegado: '/etc/ejabberd/inetrc'
/etc/ejabberd/modules.d/README.modules [Errno 13] Permiso denegado: '/etc/ejabberd/modules.d/README.modules'

-- debconf information:
  ejabberd/hostname: localhost
  ejabberd/nodenamechanges:
  ejabberd/invalidhostname:
  ejabberd/nomatch:
  ejabberd/invaliduser:
  ejabberd/user:
  ejabberd/invalidpreseed:
  ejabberd/erlangopts: -env ERL_CRASH_DUMP_BYTES 0

Reply via email to