aboutsummaryrefslogtreecommitdiff
path: root/lib/init
diff options
context:
space:
mode:
Diffstat (limited to 'lib/init')
-rw-r--r--lib/init/rdsvc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/init/rdsvc.c b/lib/init/rdsvc.c
index 09ed156..c461d98 100644
--- a/lib/init/rdsvc.c
+++ b/lib/init/rdsvc.c
@@ -204,6 +204,22 @@ static int svc_target(void *user, char *arg, rdline_t *rd)
return 0;
}
+static int svc_subreaper(void *user, char *arg, rdline_t *rd)
+{
+ service_t *svc = user;
+
+ if (try_unescape(arg, rd))
+ return -1;
+
+ if (strcmp(arg, "yes") == 0 || strcmp(arg, "on") == 0 ||
+ strcmp(arg, "true") == 0) {
+ svc->flags |= SVC_FLAG_SUB_REAPER;
+ } else {
+ svc->flags &= ~SVC_FLAG_SUB_REAPER;
+ }
+ return 0;
+}
+
static const cfg_param_t svc_params[] = {
{ "description", 0, svc_desc },
{ "exec", 1, svc_exec },
@@ -212,6 +228,7 @@ static const cfg_param_t svc_params[] = {
{ "tty", 0, svc_tty },
{ "before", 0, svc_before },
{ "after", 0, svc_after },
+ { "subreaper", 0, svc_subreaper },
};
service_t *rdsvc(int dirfd, const char *filename)