Optional debug support of actual execve() args

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-12-18 14:43:51 +01:00
1 parent 07c52f1566
commit ff5e3219be
1 file changed
+21
+21
View File
@@ -702,6 +702,27 @@ static int service_start(svc_t *svc)
}
args[i] = NULL;
#ifdef DEBUG_COMMAND_ARGS
char buf[PATH_MAX] = "";
for (i = 0; args[i]; i++) {
strlcat(buf, args[i], sizeof(buf));
strlcat(buf, " ", sizeof(buf));
}
logit(LOG_DEBUG, "DEBUG starting %s", buf);
buf[0] = 0;
strlcat(buf, svc->cmd, sizeof(buf));
strlcat(buf, " ", sizeof(buf));
for (i = 1; i < MAX_NUM_SVC_ARGS; i++) {
if (!strlen(svc->args[i]))
break;
strlcat(buf, svc->args[i], sizeof(buf));
strlcat(buf, " ", sizeof(buf));
}
logit(LOG_DEBUG, "DEBUG starting args %s", buf);
#endif
/*
* The setsid() call takes care to detach the process
* from its controlling terminal, preventing daemons