smbd: Implement a cleanup daemon
authorVolker Lendecke <vl@samba.org>
Mon, 2 Nov 2015 11:47:13 +0000 (12:47 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 16 Nov 2015 13:51:33 +0000 (14:51 +0100)
commite3e0a295c3fc25391260a8bb7d7d29137f7129fa
treed289cd103775768dd8b5d7d329a82f3c67c6602d
parentdb99742d8b15cc1c48421a4720a43dff72c6ba1b
smbd: Implement a cleanup daemon

We do way too much stuff in the parent smbd in remove_child_pid(). In
particular accessing ctdbd is not a good idea when ctdbd is stuck in something.
We've had a case where smbd exited itself with "ctdb timeout" being set to 60
seconds. ctdb was just stuck doing recoveries, and the parent smbd was sitting
in serverid_exists trying to retrieve a record for a child that had exited. Not
good.

This daemon sits there as parent->cleanupd and receives MSG_SMB_NOTIFY_CLEANUP
messages that hold the serverid and exit status of a former child. The next
commits will step by step empty remove_child_pid in the parent and move the
tasks to the helper.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/server.c
source3/smbd/smbd_cleanupd.c [new file with mode: 0644]
source3/smbd/smbd_cleanupd.h [new file with mode: 0644]
source3/wscript_build