From dd8aaf74198c084fd0aa712d56c4511978f04ebe Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 3 Aug 2009 11:55:36 +0200 Subject: Make child processes exit when parent dies The child processes call prctl() and when their parent process is killed, they are sent SIGTERM using prctl. This is currently Linux-specific, for non-Linuxes, a similar effect is achieved by catching a set of common termination signals and sending SIGTERM to the process group. --- server/providers/data_provider_be.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/providers/data_provider_be.c') diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c index c93c4531e..49885edc6 100644 --- a/server/providers/data_provider_be.c +++ b/server/providers/data_provider_be.c @@ -1109,6 +1109,12 @@ int main(int argc, const char *argv[]) return 2; } + ret = die_if_parent_died(); + if (ret != EOK) { + /* This is not fatal, don't return */ + DEBUG(2, ("Could not set up to exit when parent process does\n")); + } + ret = be_process_init(main_ctx, be_name, be_domain, main_ctx->event_ctx, -- cgit