mirror of
https://github.com/troglobit/finit.git
synced 2026-11-21 19:51:46 +00:00
Minor, add debug logs and clarify comment
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
3069e753e1
commit
6da8af8136
2 files changed
+5
-4
No files matched your search
+4
-4
@@ -59,11 +59,11 @@ int complete(char *cmd, int pid)
|
|||||||
|
|
||||||
if (waitpid(pid, &status, 0) == -1) {
|
if (waitpid(pid, &status, 0) == -1) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
errx(1, "Caught unblocked signal waiting for %s, aborting", cmd);
|
warnx("Caught unblocked signal waiting for %s, aborting", cmd);
|
||||||
else if (errno == ECHILD)
|
else if (errno == ECHILD)
|
||||||
errx(1, "Caught SIGCHLD waiting for %s, aborting", cmd);
|
warnx("Caught SIGCHLD waiting for %s, aborting", cmd);
|
||||||
else
|
else
|
||||||
errx(1, "Failed starting %s, error %d: %s", cmd, errno, strerror (errno));
|
warnx("Failed starting %s, error %d: %s", cmd, errno, strerror(errno));
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ int run(char *cmd, char *log)
|
|||||||
} else if (WIFSIGNALED(status)) {
|
} else if (WIFSIGNALED(status)) {
|
||||||
dbg("Process '%s' terminated by signal %d", cmd, WTERMSIG(status));
|
dbg("Process '%s' terminated by signal %d", cmd, WTERMSIG(status));
|
||||||
if (!result)
|
if (!result)
|
||||||
result = 1; /* Must alert callee that the command did complete successfully.
|
result = 1; /* Must alert callee the command did not complete successfully.
|
||||||
* This is necessary since not all programs trap signals and
|
* This is necessary since not all programs trap signals and
|
||||||
* change their return code accordingly. --Jocke */
|
* change their return code accordingly. --Jocke */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -652,6 +652,7 @@ static int service_start(svc_t *svc)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (pid > 1) {
|
if (pid > 1) {
|
||||||
|
dbg("Starting %s as PID %d", svc_ident(svc, NULL, 0), pid);
|
||||||
svc->pid = pid;
|
svc->pid = pid;
|
||||||
svc->start_time = jiffies();
|
svc->start_time = jiffies();
|
||||||
} else if (pid == 0) {
|
} else if (pid == 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user