S01rsyslogd 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. DAEMON="rsyslogd"
  3. PIDFILE="/var/run/$DAEMON.pid"
  4. RSYSLOGD_ARGS=""
  5. # shellcheck source=/dev/null
  6. [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
  7. start() {
  8. printf 'Starting %s: ' "$DAEMON"
  9. # shellcheck disable=SC2086 # we need the word splitting
  10. start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
  11. -- $RSYSLOGD_ARGS
  12. status=$?
  13. if [ "$status" -eq 0 ]; then
  14. echo "OK"
  15. else
  16. echo "FAIL"
  17. fi
  18. return "$status"
  19. }
  20. stop() {
  21. printf 'Stopping %s: ' "$DAEMON"
  22. start-stop-daemon -K -q -p "$PIDFILE"
  23. status=$?
  24. if [ "$status" -eq 0 ]; then
  25. echo "OK"
  26. else
  27. echo "FAIL"
  28. fi
  29. return "$status"
  30. }
  31. restart() {
  32. stop
  33. sleep 1
  34. start
  35. }
  36. case "$1" in
  37. start|stop|restart)
  38. "$1";;
  39. reload)
  40. # Restart, since there is no true "reload" feature (does not
  41. # reconfigure/restart on SIGHUP, just closes all open files).
  42. restart;;
  43. *)
  44. echo "Usage: $0 {start|stop|restart|reload}"
  45. exit 1
  46. esac