# that enables MIC clients to proxy InfiniBand RDMA over to large core resources
### END INIT INFO
-pidfile=/var/run/mpxyd.pid
-subsys=/var/lock/subsys/mpxyd
+prog=mpxyd
+execpath=@prefix@/sbin/${prog}
+pidfile=/var/run/${prog}.pid
+subsys=/var/lock/subsys/${prog}
. /etc/rc.d/init.d/functions
{
echo -n "Starting mpxyd daemon:"
- daemon @prefix@/sbin/mpxyd
+ daemon --check $prog --pidfile "${pidfile}" $execpath
RC=$?
- [ $RC -eq 0 ] && touch $subsys
+
+ [ "$RC" -eq "0" ] && touch $subsys
+
echo
return $RC
}
{
echo -n "Stopping mpxyd daemon:"
- killproc -p $pidfile mpxyd
+ killproc -p $pidfile $execpath
RC=$?
rm -f $subsys
echo
return $RC
}
-status()
+_status()
{
- if [ ! -f $subsys -a ! -f $pidfile ]; then
- return 3
- fi
- if [ -f $pidfile ]; then
- checkpid `cat $pidfile`
- return $?
- fi
- if [ -f $subsys ]; then
- return 2
- fi
+ status -p "${pidfile}" -l "${subsys}" ${prog}
}
restart ()
condrestart) condrestart; RC=$? ;;
try-restart) condrestart; RC=$? ;;
force-reload) condrestart; RC=$? ;;
- status) status; RC=$? ;;
+ status) _status; RC=$? ;;
*) usage; RC=$? ;;
esac