]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
Allow the init script be run as regular user.
authorJianxin Xiong <jianxin.xiong@intel.com>
Fri, 28 Sep 2012 22:34:38 +0000 (15:34 -0700)
committerJianxin Xiong <jianxin.xiong@intel.com>
Mon, 1 Oct 2012 17:21:12 +0000 (10:21 -0700)
From: pmmccorm <patrick.m.mccormick@intel.com>

mpxyd.init.in

index 11532fb7e5d7bb40eda3506273d07daf86793fa6..a21b77a1aa7eae8e9b6d60fccb969aca21654d0f 100644 (file)
@@ -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=$? ;;