aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Johan Oudinet <johan.oudinet@gmail.com>2015-04-15 17:39:06 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-04-19 11:11:11 +0200
commitf266a36d62b5ac3b418ab15675c72fc172ab24fe (patch)
tree048f0b484d8324dcd10291279c2df5f590dbf925
parent0972c9c10b3aa9466528fb5a0f30f37545b2c876 (diff)
downloadbuildroot-f266a36d62b5ac3b418ab15675c72fc172ab24fe.tar.gz
buildroot-f266a36d62b5ac3b418ab15675c72fc172ab24fe.tar.bz2
ejabberd: allow one to change SPOOLDIR location
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>
-rw-r--r--package/ejabberd/S50ejabberd9
1 files changed, 7 insertions, 2 deletions
diff --git a/package/ejabberd/S50ejabberd b/package/ejabberd/S50ejabberd
index 925a072ddc..a4710781db 100644
--- a/package/ejabberd/S50ejabberd
+++ b/package/ejabberd/S50ejabberd
@@ -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... "