From 71163a5232c0a9c43fa3c4de3de4a465c0a89c7f Mon Sep 17 00:00:00 2001 From: Jianxin Xiong Date: Fri, 28 Sep 2012 15:34:38 -0700 Subject: [PATCH] Allow the init script be run as regular user. From: pmmccorm --- mpxyd.init.in | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/mpxyd.init.in b/mpxyd.init.in index 11532fb..a21b77a 100644 --- a/mpxyd.init.in +++ b/mpxyd.init.in @@ -29,10 +29,10 @@ start() { echo -n "Starting mpxyd daemon:" - daemon --check $prog --pidfile "${pidfile}" $execpath + daemon --check $prog --pidfile "$pidfile" $execpath RC=$? - [ "$RC" -eq "0" ] && touch $subsys + [ "$RC" -eq "0" ] && touch $subsys 2>/dev/null echo return $RC @@ -42,7 +42,7 @@ stop() { echo -n "Stopping mpxyd daemon:" - killproc -p $pidfile $execpath + killproc -p "$pidfile" $execpath RC=$? rm -f $subsys echo @@ -51,7 +51,7 @@ stop() _status() { - status -p "${pidfile}" -l "${subsys}" ${prog} + status -p "$pidfile" -l $subsys $prog } restart () @@ -73,11 +73,6 @@ usage () return 2 } -case $1 in - start|stop|restart|condrestart|try-restart|force-reload) - [ `id -u` != "0" ] && exit 4 ;; -esac - case $1 in start) start; RC=$? ;; stop) stop; RC=$? ;; -- 2.41.0