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 <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-04-23 17:12:59 +02:00
1 parent b8b7b53d96
commit 25c5014d3c
1 file changed
+6
+6
View File
@@ -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);