Fix wrong path to command in service after reload, may have changed

Service/task/run are today identified by name:id this means the path to
a command is not necessarily the basis for the identity.  Hence, an
svc_t can now be updated with new the correct path to a command.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-08-12 15:08:14 +02:00
parent f08d375c36
commit e2f070649d
+3
View File
@@ -1382,6 +1382,9 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
/* update type, may have changed from service -> task */
svc->type = type;
/* update path, may have changed on reload */
strlcpy(svc->cmd, cmd, sizeof(svc->cmd));
/* e.g., if missing cmd or env before */
if (!manual)
svc_unblock(svc);