9

I see ExecStop=-/sbin/start-stop-daemon in the nginx.service file, what does -/sbin mean?

[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid
TimeoutStopSec=5
KillMode=mixed
tcpiper
  • 2,456
  • 2
  • 28
  • 41
  • I'm voting to close this question as off-topic because questions about the Linux operating system and its tools should, instead, be asked on https://unix.stackexchange.com/ – Rob Aug 31 '19 at 09:59

1 Answers1

9

If the executable path is prefixed with "-", an exit code of the command normally considered a failure (i.e. non-zero exit status or abnormal exit due to signal) is recorded, but has no further effect and is considered equivalent to success.

From Table 1. Special executable prefixes in https://www.freedesktop.org/software/systemd/man/systemd.service.html

Dan D.
  • 73,243
  • 15
  • 104
  • 123