aboutsummaryrefslogtreecommitdiff
path: root/initd/runsvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'initd/runsvc.c')
-rw-r--r--initd/runsvc.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/initd/runsvc.c b/initd/runsvc.c
index 5495f15..682f4c6 100644
--- a/initd/runsvc.c
+++ b/initd/runsvc.c
@@ -195,18 +195,6 @@ pid_t runsvc(service_t *svc)
perror("fork");
if (pid == 0) {
- cli(NULL);
-
- memset(&act, 0, sizeof(act));
- act.sa_handler = runsvc_sighandler;
- sigaction(SIGTERM, &act, NULL);
- sigaction(SIGINT, &act, NULL);
- sigaction(SIGHUP, &act, NULL);
-
- act.sa_handler = SIG_DFL;
- sigaction(SIGUSR1, &act, NULL);
- sigaction(SIGCHLD, &act, NULL);
-
if (setup_env())
exit(EXIT_FAILURE);
@@ -218,6 +206,11 @@ pid_t runsvc(service_t *svc)
exit(EXIT_FAILURE);
}
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = runsvc_sighandler;
+ sigaction(SIGTERM, &act, NULL);
+ sigaction(SIGINT, &act, NULL);
+ sigaction(SIGHUP, &act, NULL);
sti(NULL);
if (svc->flags & SVC_FLAG_SUB_REAPER) {