#!/bin/sh # # /etc/init.d/spacenavd # and its symbolic link # /usr/sbin/rcspacenavd # ### BEGIN INIT INFO # Provides: spacenavd # Required-Start: $syslog $remote_fs # Should-Start: # Required-Stop: $syslog $remote_fs # Should-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: spacenavd daemon for 3d connexion devices # Description: Start spacenavd to control 3d connexion devices ### END INIT INFO # # Check for missing binaries (stale symlinks should not happen) # Note: Special treatment of stop for LSB conformance SPACENAVD_BIN=/usr/sbin/spacenavd test -x $SPACENAVD_BIN || { echo "$SPACENAVD_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } # Check for existence of needed config file and read it #SPACENAVD_CONFIG=/etc/sysconfig/spacenavd #test -r $SPACENAVD_CONFIG || { echo "$SPACENAVD_CONFIG not existing"; # if [ "$1" = "stop" ]; then exit 0; # else exit 6; fi; } # Read config #. $SPACENAVD_CONFIG . /etc/rc.status # Reset status of this service rc_reset case "$1" in start) echo -n "Starting spacenavd" /sbin/startproc $SPACENAVD_BIN # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down spacenavd" /sbin/killproc -TERM $SPACENAVD_BIN # Remember status and be verbose rc_status -v ;; try-restart|condrestart) if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi # Remember status and be quiet rc_status ;; restart) $0 stop $0 start # Remember status and be quiet rc_status ;; force-reload) echo -n "Reload service spacenavd" ## if it supports it: /sbin/killproc -HUP $SPACENAVD_BIN touch /var/run/spnavd.pid rc_status -v ;; reload) # If it supports signaling: echo -n "Reload service spacenavd" /sbin/killproc -HUP $SPACENAVD_BIN touch /var/run/spnavd.pid rc_status -v ;; status) echo -n "Checking for service spacenavd" /sbin/checkproc $SPACENAVD_BIN rc_status -v ;; probe) test /etc/spnavrc -nt /var/run/spnavd.pid && echo reload ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" exit 1 ;; esac rc_exit