Commit f266a36d authored by Johan Oudinet's avatar Johan Oudinet Committed by Thomas Petazzoni
Browse files

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: default avatarJohan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 0972c9c1
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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... "