From 25c5014d3cf423f9f3ba8dc9ce821ce8d11729da Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 23 Apr 2021 17:12:59 +0200 Subject: [PATCH] Also check env: file for changes to detect svc->args_dirty This patch fixes an issue where services that support SIGHUP are not properly stop/started on changes to their command line arguments. A change to a service's env: file, e.g. /etc/default/foo for service foo, must also be counted as a change to the foo args. Signed-off-by: Joachim Wiberg --- src/service.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/service.c b/src/service.c index 1875aa5c..0a87c055 100644 --- a/src/service.c +++ b/src/service.c @@ -1044,6 +1044,12 @@ static void parse_cmdline_args(svc_t *svc, char *cmd) } } + /* + * Check also for changes to /etc/default/foo, because this + * also constitutes changes to command line args. + */ + diff += conf_changed(svc_getenv(svc)); + if (diff) _d("Modified args for %s detected", cmd); svc->args_dirty = (diff > 0);