#958307 document how to make a backup

Package:
ejabberd
Source:
ejabberd
Description:
extensible realtime platform (XMPP server + MQTT broker + SIP service)
Submitter:
Santiago Castillo Oli
Date:
2022-06-02 11:51:03 UTC
Severity:
normal
Tags:
#958307#5
Date:
2020-04-20 12:06:30 UTC
From:
To:
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.

#958307#10
Date:
2020-04-22 20:02:58 UTC
From:
To:
Hi

Am 20.04.20 um 14:06 schrieb Santiago Castillo Oli:

executing
 /var/lib/dpkg/info/ejabberd.prerm upgrade
works like a charm.

The trick is to create a writable directory for ejabberd inside
/var/backups.


Indeed, the documentation could be improved.


Regards

#958307#19
Date:
2022-06-02 11:49:27 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
ejabberd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 958307@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Philipp Huebner <debalance@debian.org> (supplier of updated ejabberd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 02 Jun 2022 13:26:51 +0200
Source: ejabberd
Architecture: source
Version: 22.05-1
Distribution: unstable
Urgency: medium
Maintainer: Ejabberd Packaging Team <ejabberd@packages.debian.org>
Changed-By: Philipp Huebner <debalance@debian.org>
Closes: 958307 993039
Changes:
 ejabberd (22.05-1) unstable; urgency=medium
 .
   * New upstream version 22.05
   * Refreshed patches
   * Updated Erlang dependencies
   * Updated Standards-Version: 4.6.1 (no changes needed)
   * Updated years in debian/copyright
   * Added autopkgtests (Closes: #993039)
   * Improved README.Debian (Closes: #958307)
Checksums-Sha1:
 33045adfd008545251b2f2e2d5ec29b56ed1a7dd 3092 ejabberd_22.05-1.dsc
 331ebc8e1ba4b262f2c061edc1a543616569cdaf 1427550 ejabberd_22.05.orig.tar.gz
 b80a46d4c5dc62790f97f8e77414dff0f3fe45da 66932 ejabberd_22.05-1.debian.tar.xz
 379f329196dca59e5708925a70d8f74fa5c2c45b 14331 ejabberd_22.05-1_amd64.buildinfo
Checksums-Sha256:
 5d1a4b1962b919f439d882ad977660a354754cead9fb7e489e81c9a39f2210f2 3092 ejabberd_22.05-1.dsc
 2549dd12240a7b4201809f7112de173f827cbf23e7eb86c85f0226d36590eef0 1427550 ejabberd_22.05.orig.tar.gz
 165a6ad75fbe8e4d3832f980bb5a0ef42576e87beee834269a95399b23a7cf8b 66932 ejabberd_22.05-1.debian.tar.xz
 c188a448f49ec7d22d8d9ff6f958bf58b44af92d31b2f1d3b1adc760b154e5b1 14331 ejabberd_22.05-1_amd64.buildinfo
Files:
 f05e918bcb91ae4e3a24001ea8ecbfd5 3092 net optional ejabberd_22.05-1.dsc
 131806981e7cbc53af64fd1e0aab9db1 1427550 net optional ejabberd_22.05.orig.tar.gz
 681315147bbfb6803b9bb8222decbc1b 66932 net optional ejabberd_22.05-1.debian.tar.xz
 d3d934224c5dafd523e6616c7914371c 14331 net optional ejabberd_22.05-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCgAzFiEECEGLvkRyDy26xQXsunokltrkDRwFAmKYojwVHGRlYmFsYW5j
ZUBkZWJpYW4ub3JnAAoJELp6JJba5A0cTvAQAJY/HLGjFFUVXYbQV/TNXRE4HjAS
5/d0jB8352IkOPyBDaVE08zDThZ7t4wD7DKGR+cnL0GK2b52JN7IawdORS/Xvf76
ovqbp03kmFOfpS+jqLsWT0FxxPfdW/CT56KgKDu8PzWw0o5kIbDu5ZA1vu2Zw4TF
0JWRwK8G2u5lcp3Ioxx/EMymCfL9/0osYrfRPz9V0ZuX6vYCFaJvU5o1GUawjhgu
aHWhx2lZ2RYhfKwjwq2xokrp5EZpTPLLeg5E5pigFmAE6PQl4JtGdloVTo5oRXcf
Nw6r2QZaGsjqmb6cs9YiDETHKwNo5hTHhLlQRJM8vwd4rlqXTQmV0U3LOUT/tzJH
XrKoGo56TmAY/lDXc1KhvI6hG55hOLykINNEZ/l31bRSBVkoMqSlX4qmyLjWcZ+7
BGs0FJyBcjqwogu5n7jNpelje8G3WoTzNsA0ucBjHbmVpzqgRmNsCxlbJYaIo3Sg
5aLxgM6zHEG4S2XCYbjGy0BHs0e/GidUuI8lPDRpSZblSl+kRK3/9h4yysOMuE1i
DNqHomFYIeCEzxEPIUCUKcEK/SNx/bNORNfapVlw/SDpVGzPkgnttemelIbNkhOB
pPKro8jY6yrlvitL6D6STRX4TTdYWkTkIaJdP1WWKBvZIvO6q1IajUgoJllMmiEo
zuHmKEGtORLzVke1
=i+QS
-----END PGP SIGNATURE-----