mirror of
https://github.com/troglobit/finit.git
synced 2026-10-29 12:40:44 +00:00
Merge pull request #153 from troglobit/logit-post-signal
Logit post SIGTERM, SIGINT etc.
This commit is contained in:
1 file changed
+6
-6
+6
-6
@@ -191,9 +191,6 @@ static int lredirect(svc_t *svc)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dup2(fd, STDOUT_FILENO);
|
|
||||||
dup2(fd, STDERR_FILENO);
|
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
int fds;
|
int fds;
|
||||||
@@ -240,6 +237,9 @@ static int lredirect(svc_t *svc)
|
|||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dup2(fd, STDOUT_FILENO);
|
||||||
|
dup2(fd, STDERR_FILENO);
|
||||||
|
|
||||||
return close(fd);
|
return close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,6 +371,9 @@ static int service_start(svc_t *svc)
|
|||||||
}
|
}
|
||||||
args[i] = NULL;
|
args[i] = NULL;
|
||||||
|
|
||||||
|
redirect(svc);
|
||||||
|
sig_unblock();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The setsid() call is the most humble of all in this
|
* The setsid() call is the most humble of all in this
|
||||||
* function. It takes care to detach the process from
|
* function. It takes care to detach the process from
|
||||||
@@ -385,9 +388,6 @@ static int service_start(svc_t *svc)
|
|||||||
*/
|
*/
|
||||||
setsid();
|
setsid();
|
||||||
|
|
||||||
redirect(svc);
|
|
||||||
sig_unblock();
|
|
||||||
|
|
||||||
if (svc_is_runtask(svc))
|
if (svc_is_runtask(svc))
|
||||||
status = exec_runtask(svc->cmd, args);
|
status = exec_runtask(svc->cmd, args);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user