aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-11-06 02:14:26 +0100
committerWilliam Hubbs <w.d.hubbs@gmail.com>2022-12-07 16:42:14 -0600
commit953172c6c670d10d36ea3917243079b86ecc102d (patch)
treec1ce812744db12938de344f11e502f71b454f93a
parent0525de4f182af8292cd0ce4f4cacc17ea463b8bc (diff)
supervise-daemon: don't overwrite empty supervise_daemon_args
If supervise_daemon_args is not set *or empty*, it defaults to `start_stop_daemon_args`. This is bad because supervise-daemon doesn't accept the same options as `start-stop-daemon`. So if we set e.g. `start_stop_daemon_args="--wait 50"`, but not `supervise_daemon_args`, and the user adds `supervisor=supervise-daemon` to the corresponding /etc/conf.d/<service> file, the service will fail to start due to unrecognized option "wait". It would be best to remove this fallback, but that might break some existing scripts that depend on it. So this commit just changes it to use `start_stop_daemon_args` as the default for `supervise_daemon_args` only if `supervise_daemon_args` is not set at all, but not if it's empty. This at least simplifies workarounds; we can just add `supervise_daemon_args="$supervise_daemon_args"` to init scripts. This fixes #558.
-rw-r--r--sh/supervise-daemon.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/sh/supervise-daemon.sh b/sh/supervise-daemon.sh
index 8d2d6faf..8eb98a17 100644
--- a/sh/supervise-daemon.sh
+++ b/sh/supervise-daemon.sh
@@ -41,7 +41,7 @@ supervise_start()
${no_new_privs:+--no_new_privs} \
${command_user+--user} $command_user \
${umask+--umask} $umask \
- ${supervise_daemon_args:-${start_stop_daemon_args}} \
+ ${supervise_daemon_args-${start_stop_daemon_args}} \
$command \
-- $command_args $command_args_foreground
rc=$?