summaryrefslogtreecommitdiff
path: root/aports/openrc/0009-dont-overwrite-empty-supervise_daemon_args.patch
blob: 4716d06a357927a40df6feb2f95448706f06b4ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Patch-Source: https://github.com/OpenRC/openrc/pull/558
--
From a2f1d65f1646e5f539e986f22964cf078ba58fce Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sun, 6 Nov 2022 02:14:26 +0100
Subject: [PATCH] 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.
---
 sh/supervise-daemon.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sh/supervise-daemon.sh b/sh/supervise-daemon.sh
index 8d2d6faff..8eb98a17a 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=$?