From ab886cad308592163caf9b15ba60e4f07e0395d6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 13 Dec 2012 10:09:25 -0600 Subject: [PATCH] FS-4931 --resolve ok, the binary also tries to make the dir but its probably failing from dropped perms. probably if the freeswitch user had write perms in /var/run it would also work --- debian/freeswitch-sysvinit.freeswitch.init | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/freeswitch-sysvinit.freeswitch.init b/debian/freeswitch-sysvinit.freeswitch.init index 2b48cfd852..5f8b028bcc 100644 --- a/debian/freeswitch-sysvinit.freeswitch.init +++ b/debian/freeswitch-sysvinit.freeswitch.init @@ -18,7 +18,9 @@ NAME=freeswitch DAEMON=/usr/bin/freeswitch DAEMON_ARGS="-u freeswitch -g freeswitch -rp -nc -nonat" USER=freeswitch -PIDFILE=/var/run/$NAME/$NAME.pid +GROUP=freeswitch +RUNDIR=/var/run/$NAME +PIDFILE=$RUNDIR/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME WORKDIR=/var/lib/$NAME @@ -28,6 +30,11 @@ WORKDIR=/var/lib/$NAME . /lib/lsb/init-functions do_start() { + # Directory in /var/run may disappear on reboot (e.g. when tmpfs used for /var/run). + mkdir -p $RUNDIR + chown -R $USER:$GROUP $RUNDIR + chmod -R ug=rwX,o= $RUNDIR + start-stop-daemon --start --quiet \ --pidfile $PIDFILE --exec $DAEMON --name $NAME --user $USER \ --test > /dev/null \