Created
April 6, 2018 19:17
-
-
Save andrey-utkin/cf3fd47aeacf6dd0657d18e1811dd72f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sh/start-stop-daemon.sh b/sh/start-stop-daemon.sh | |
index 35c642c0..693fe883 100644 | |
--- a/sh/start-stop-daemon.sh | |
+++ b/sh/start-stop-daemon.sh | |
@@ -80,6 +80,12 @@ ssd_stop() | |
pidfile="${startpidfile:-$pidfile}" | |
procname="${startprocname:-$procname}" | |
[ -n "$command" -o -n "$procname" -o -n "$pidfile" ] || return 0 | |
+ | |
+ # Allow restarting a crashed daemon with missing pidfile. | |
+ # Some daemons remove pidfile when they terminate on their own. | |
+ # s-s-d fails stopping if pidfile is missing. | |
+ [ -n "$pidfile" -a ! -e "$pidfile" ] && return 0 | |
+ | |
yesno "${command_progress}" && _progress=--progress | |
ebegin "Stopping ${name:-$RC_SVCNAME}" | |
start-stop-daemon --stop \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment