Check for config before starting

...so we can tell people what to do and where to look.
This commit is contained in:
Travis Cross 2013-06-16 14:21:44 +00:00
parent f858176f89
commit 90683e3332
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,7 @@ DAEMON=/usr/bin/freeswitch
DAEMON_ARGS="-u freeswitch -g freeswitch -nc"
USER=freeswitch
GROUP=freeswitch
CONFDIR=/etc/$NAME
RUNDIR=/var/run/$NAME
PIDFILE=$RUNDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
@ -30,6 +31,12 @@ WORKDIR=/var/lib/$NAME
. /lib/lsb/init-functions
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).
mkdir -p $RUNDIR
chown -R $USER:$GROUP $RUNDIR