| 1 | /* |
| 2 | * Copyright (C) 2011 EfficiOS Inc. |
| 3 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 4 | * Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-only |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | #include "lttng-sessiond.hpp" |
| 11 | |
| 12 | #include <signal.h> |
| 13 | |
| 14 | /* Notify parents that we are ready for cmd and health check */ |
| 15 | void sessiond_signal_parents() |
| 16 | { |
| 17 | /* |
| 18 | * Notify parent pid that we are ready to accept command |
| 19 | * for client side. This ppid is the one from the |
| 20 | * external process that spawned us. |
| 21 | */ |
| 22 | if (the_config.sig_parent) { |
| 23 | kill(the_ppid, SIGUSR1); |
| 24 | } |
| 25 | |
| 26 | /* |
| 27 | * Notify the parent of the fork() process that we are |
| 28 | * ready. |
| 29 | */ |
| 30 | if (the_config.daemonize || the_config.background) { |
| 31 | kill(the_child_ppid, SIGUSR1); |
| 32 | } |
| 33 | } |