aboutsummaryrefslogtreecommitdiff
path: root/initd/runsvc.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <goliath@infraroot.at>2020-05-14 17:49:44 +0200
committerDavid Oberhollenzer <goliath@infraroot.at>2020-05-14 18:12:03 +0200
commit9606d987722ee5b89bbfae230389d3385a3884b0 (patch)
tree716b63d0cbab18a1061967b731c9d65c494bfbc0 /initd/runsvc.c
parent5b5fc677b313908b8d1a775cd6af08202841d908 (diff)
Replace standard signal handling in initd with signalfd + epoll
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
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) {