aboutsummaryrefslogtreecommitdiffstats
path: root/bitlbee.h
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-10-27 03:07:02 -0300
committerdequis <dx@dxzone.com.ar>2015-10-30 07:31:09 -0300
commit2e99039dbc86bbf04320fdb2cf652e9c71a58af2 (patch)
tree044249e8a9bc961cf9783d160033813b83c5d65f /bitlbee.h
parentad8a81000e874dc3f20c8d97ef698604a67ead4b (diff)
Avoid propagating shutdown signal to all subprocesses
This was a sort-of-regression with 7233f68 While this behavior might seem desirable in some cases, multi-user installs like public servers would rather not kill children while upgrading. Turns out that pipes are inherited by forks, and writing in one side means there might be more than one listener that calls bitlbee_shutdown(). If the parent gets it, the children will get it too. If a child gets it, the parent and the other children get it too. This adds a sighandler_shutdown_setup() function that closes any previously existing pipes and disconnects the events from them, to create a new one. This is called again after forking each child process. While I'm sure this fixes the issue, I still don't understand why it *didn't* kill the forked processes in some cases. Worrying.
Diffstat (limited to 'bitlbee.h')
-rw-r--r--bitlbee.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/bitlbee.h b/bitlbee.h
index 49a5496a..447e2e64 100644
--- a/bitlbee.h
+++ b/bitlbee.h
@@ -157,6 +157,8 @@ typedef struct global {
int restart;
} global_t;
+void sighandler_shutdown_setup(void);
+
int bitlbee_daemon_init(void);
int bitlbee_inetd_init(void);