# Should-Stop:
# Short-Description: Starts and stops the MIC SCIF/DAPL RDMA proxy server
# Description: The DAPL proxy RDMA server provides a user space implementation
-# that enables MIC clients to proxy InfiniBand RDMA over to large core resources
+# that enables MIC clients to proxy InfiniBand RDMA over to large core resources
### END INIT INFO
prog=mpxyd
pidfile=`grep ^lock_file @sysconfdir@/mpxyd.conf | awk '{print $2}'`
subsys=/var/lock/subsys/${prog}
-. /etc/rc.d/init.d/functions
+# Source function library.
+if [ -f /etc/init.d/functions ]; then
+ # RHEL
+ . /etc/init.d/functions
+ _status='status -p "$pidfile" -l $subsys'
+ _start='daemon --check $prog --pidfile "$pidfile"'
+ _ret='echo; return $RC'
+elif [ -f /etc/rc.status ]; then
+ # SLES
+ . /etc/rc.status
+ _status=checkproc
+ _start='start_daemon -p "$pidfile"'
+ _ret='rc_status -v'
+else
+ # other
+ echo "Could not source init function library, exiting"
+ return 1
+fi
start()
{
- echo -n "Starting mpxyd daemon:"
+ echo -n "Starting mpxyd daemon: "
- daemon --check $prog --pidfile "$pidfile" $execpath
+ eval $_start $execpath
RC=$?
[ "$RC" -eq "0" ] && touch $subsys 2>/dev/null
- echo
- return $RC
+ eval $_ret
}
stop()
{
- echo -n "Stopping mpxyd daemon:"
+ echo -n "Stopping mpxyd daemon: "
- killproc -p "$pidfile" $execpath
+ killproc -p $pidfile $execpath
RC=$?
rm -f $subsys
- echo
- return $RC
+
+ eval $_ret
}
-_status()
+sstatus()
{
- status -p "$pidfile" -l $subsys $prog
+ eval $_status $execpath RC=$?
+ eval $_ret
}
restart ()
condrestart) condrestart; RC=$? ;;
try-restart) condrestart; RC=$? ;;
force-reload) condrestart; RC=$? ;;
- status) _status; RC=$? ;;
+ status) sstatus; RC=$? ;;
*) usage; RC=$? ;;
esac