Check for config before starting
...so we can tell people what to do and where to look.
This commit is contained in:
parent
f858176f89
commit
90683e3332
|
@ -19,6 +19,7 @@ DAEMON=/usr/bin/freeswitch
|
||||||
DAEMON_ARGS="-u freeswitch -g freeswitch -nc"
|
DAEMON_ARGS="-u freeswitch -g freeswitch -nc"
|
||||||
USER=freeswitch
|
USER=freeswitch
|
||||||
GROUP=freeswitch
|
GROUP=freeswitch
|
||||||
|
CONFDIR=/etc/$NAME
|
||||||
RUNDIR=/var/run/$NAME
|
RUNDIR=/var/run/$NAME
|
||||||
PIDFILE=$RUNDIR/$NAME.pid
|
PIDFILE=$RUNDIR/$NAME.pid
|
||||||
SCRIPTNAME=/etc/init.d/$NAME
|
SCRIPTNAME=/etc/init.d/$NAME
|
||||||
|
@ -30,6 +31,12 @@ WORKDIR=/var/lib/$NAME
|
||||||
. /lib/lsb/init-functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
do_start() {
|
do_start() {
|
||||||
|
if ! [ -f $CONFDIR/freeswitch.xml ]; then
|
||||||
|
echo "$NAME is not configured so not starting.">&2
|
||||||
|
echo "Please review /usr/share/doc/$NAME/README.Debian">&2
|
||||||
|
return 3
|
||||||
|
fi
|
||||||
|
|
||||||
# Directory in /var/run may disappear on reboot (e.g. when tmpfs used for /var/run).
|
# Directory in /var/run may disappear on reboot (e.g. when tmpfs used for /var/run).
|
||||||
mkdir -p $RUNDIR
|
mkdir -p $RUNDIR
|
||||||
chown -R $USER:$GROUP $RUNDIR
|
chown -R $USER:$GROUP $RUNDIR
|
||||||
|
|
Loading…
Reference in New Issue