| PIDFILE="/var/run/$DAEMON.pid" |
| # shellcheck source=/dev/null |
| [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" |
| printf 'Starting %s: ' "$DAEMON" |
| # shellcheck disable=SC2086 # we need the word splitting |
| start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \ |
| if [ "$status" -eq 0 ]; then |
| printf 'Stopping %s: ' "$DAEMON" |
| start-stop-daemon -K -q -p "$PIDFILE" |
| if [ "$status" -eq 0 ]; then |
| # Restart, since there is no true "reload" feature (does not |
| # reconfigure/restart on SIGHUP, just closes all open files). |
| echo "Usage: $0 {start|stop|restart|reload}" |