diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-11-09 04:24:29 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-11-09 04:24:29 +0300 |
commit | a84aa6c83cc43d1845550c600e8177efbdbd4cbe (patch) | |
tree | 870d0f382e82df53469036011fc1107cccb943c2 /scripts/murmur.init | |
parent | 2854f19cb7a3f3398da810d223f8e3f69442b37e (diff) |
More Ubuntu fixes
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@849 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'scripts/murmur.init')
-rwxr-xr-x | scripts/murmur.init | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/murmur.init b/scripts/murmur.init index 1ceb72859..0591a1536 100755 --- a/scripts/murmur.init +++ b/scripts/murmur.init @@ -14,9 +14,11 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=murmur DESC="Murmur VoIP Server" -PIDFILE=/var/run/murmur/murmur.pid +PIDDIR=/var/run/murmur +PIDFILE=$PIDDIR/murmur.pid DAEMON=/usr/sbin/murmurd - +USER=Murmur +GROUP=Murmur test -x $DAEMON || exit 0 INIFILE=/etc/murmur.ini @@ -33,9 +35,10 @@ fi case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + [ -d $PIDDIR ] || install -o $USER -d $PIDDIR start-stop-daemon --start --quiet \ --pidfile $PIDFILE \ - --chuid Murmur:Murmur \ + --chuid $USER:$GROUP \ --exec $DAEMON \ -- $DAEMON_OPTS case "$?" in @@ -48,7 +51,7 @@ case "$1" in start-stop-daemon --stop --quiet \ --retry=TERM/30/KILL/5 \ --pidfile $PIDFILE \ - --user Murmur \ + --user $USER \ --exec $DAEMON case "$?" in 0|1) rm -f $PIDFILE @@ -60,7 +63,7 @@ case "$1" in force-reload) start-stop-daemon --stop --test --quiet \ --pidfile $PIDFILE \ - --user Murmur \ + --user $USER \ --exec $DAEMON \ && $0 restart || exit 0 ;; @@ -69,14 +72,15 @@ case "$1" in start-stop-daemon --stop --quiet \ --retry=TERM/30/KILL/5 \ --pidfile $PIDFILE \ - --user Murmur \ + --user $USER \ --exec $DAEMON case "$?" in 0|1) + [ -d $PIDDIR ] || install -o $USER -d $PIDDIR rm -f $PIDFILE start-stop-daemon --start --quiet \ --pidfile $PIDFILE \ - --chuid Murmur:Murmur \ + --chuid $USER:$GROUP \ --exec $DAEMON \ -- $DAEMON_OPTS case "$?" in |