spacepaste

  1.  
  2. #!/bin/sh
  3. #
  4. # /etc/rc.d/murmur: start/stop inet daemon
  5. #
  6. SSD=/sbin/start-stop-daemon
  7. PROG=/usr/bin/murmurd
  8. OPTS="-ini /etc/murmur.ini"
  9. case $1 in
  10. start)
  11. $SSD --start --exec $PROG -- $OPTS > /dev/null 2>&1
  12. ;;
  13. stop)
  14. $SSD --stop --retry 10 --exec $PROG > /dev/null 2>&1
  15. ;;
  16. restart)
  17. $0 stop
  18. $0 start
  19. ;;
  20. status)
  21. $SSD --status --exec $PROG
  22. case $? in
  23. 0) echo "$PROG is running with pid $(pidof $PROG)" ;;
  24. 1) echo "$PROG is not running but the pid file $PID exists" ;;
  25. 3) echo "$PROG is not running" ;;
  26. 4) echo "Unable to determine the program status" ;;
  27. esac
  28. ;;
  29. *)
  30. echo "usage: $0 [start|stop|restart|status]"
  31. ;;
  32. esac
  33. # End of file
  34.