init-arexxd 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: arexxd
  4. # Required-Start: $remote_fs $syslog ntp
  5. # Required-Stop: $remote_fs $syslog
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Starts arexxd
  9. # Description: Starts the Arexx data logger receiver daemon
  10. ### END INIT INFO
  11. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  12. DAEMON=/usr/local/sbin/arexxd
  13. NAME=arexxd
  14. DESC="Arexx data logger daemon"
  15. OPTIONS="--debug-packets"
  16. . /lib/lsb/init-functions
  17. test -f $DAEMON || exit 0
  18. set -e
  19. case "$1" in
  20. start)
  21. echo -n "Starting $DESC: "
  22. start-stop-daemon --quiet --start --chuid arexxd:arexxd --exec $DAEMON -- $OPTIONS
  23. echo "$NAME."
  24. ;;
  25. stop)
  26. echo -n "Stopping $DESC: "
  27. start-stop-daemon --quiet --oknodo --stop --user arexxd --exec $DAEMON
  28. echo "$NAME."
  29. ;;
  30. restart|force-reload)
  31. echo -n "Restarting $DESC: "
  32. start-stop-daemon --quiet --oknodo --stop --user arexxd --exec $DAEMON
  33. sleep 1
  34. start-stop-daemon --quiet --start --chuid arexxd:arexxd --exec $DAEMON -- $OPTIONS > /dev/null 2>&1
  35. echo "$NAME."
  36. ;;
  37. status)
  38. status_of_proc $DAEMON $NAME
  39. ;;
  40. *)
  41. N=/etc/init.d/$NAME
  42. echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
  43. exit 1
  44. ;;
  45. esac
  46. exit 0