]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
ejabberd: allow one to change SPOOLDIR location
authorJohan Oudinet <johan.oudinet@gmail.com>
Wed, 15 Apr 2015 15:39:06 +0000 (17:39 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 19 Apr 2015 09:11:11 +0000 (11:11 +0200)
By default, ejabberd saves the mnesia database into /var/lib/ejabberd.
Otherwise, one might want to change this location (e.g., if /var/lib is
read-only). Add an option in the init script to offer this possibility.

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/ejabberd/S50ejabberd

index 925a072ddc61639cdf2626a5bae763b74a88a8af..a4710781db715e756e9327858430209b4c736743 100644 (file)
@@ -3,11 +3,16 @@
 # Start/stop ejabberd
 #
 
+NAME=ejabberd
 USER=ejabberd
 RUNDIR=/var/run/ejabberd
+SPOOLDIR=/var/lib/ejabberd
+
+# Read configuration variable file if it is present.
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
 mkrundir() {
-    install -d -o "$USER" -g "$USER" "$RUNDIR"
+    install -d -o "$USER" -g "$USER" "$RUNDIR" "$SPOOLDIR"
 }
 
 # Run ejabberdctl as user $USER.
@@ -19,7 +24,7 @@ case "$1" in
     start)
         mkrundir || exit 1
         echo -n "Starting ejabberd... "
-        ctl start
+        ctl start --spool "$SPOOLDIR"
         ;;
     stop)
         echo -n "Stopping ejabberd... "