diff options
author | Aravind Srinivasan <aravind.srinivasan@isilon.com> | 2009-06-16 15:11:32 -0700 |
---|---|---|
committer | Steven Danneman <steven.danneman@isilon.com> | 2009-06-22 19:09:37 -0700 |
commit | 5a4d61810961af199859dfb52981632bfe594e95 (patch) | |
tree | 966ff8100e8ed1edcf57f83ea5c8a0006baecfd8 /source3/printing/printing.c | |
parent | 36a8abce4f737102b5a2acf3c0e221391079831d (diff) | |
download | samba-5a4d61810961af199859dfb52981632bfe594e95.tar.gz samba-5a4d61810961af199859dfb52981632bfe594e95.tar.xz samba-5a4d61810961af199859dfb52981632bfe594e95.zip |
s3: forward MSG_DEBUG from smbd parent to all children
Before 3.3, an smbcontrol debug message sent to the target "smbd" would
actually be sent to all running processes including nmbd and winbindd.
This behavior was changed in 3.3 so that the "smbd" target would only
send a message to the process found in smbd.pid, while the "all" target
would send a message to all processes.
The ability to set the debug level of all processes within a single
daemon, without specifying each pid is quite useful. This was implemented
in winbindd in 065760ed. This patch does the same thing for smbd.
Upon receiving a MSG_DEBUG the parent smbd will rebroadcast it to all of
its children.
The printing process has been added to the list of smbd child processes,
and we now always track the number of smbd children regardless of the
"max smbd processes" setting.
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r-- | source3/printing/printing.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index e73669fef5b..986176d6d14 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1399,6 +1399,22 @@ static void printing_pause_fd_handler(struct tevent_context *ev, exit_server_cleanly(NULL); } +static void add_child_pid(pid_t pid) +{ + extern struct child_pid *children; + struct child_pid *child; + extern int num_children; + + child = SMB_MALLOC_P(struct child_pid); + if (child == NULL) { + DEBUG(0, ("Could not add child struct -- malloc failed\n")); + return; + } + child->pid = pid; + DLIST_ADD(children, child); + num_children += 1; +} + static pid_t background_lpq_updater_pid = -1; /**************************************************************************** @@ -1426,6 +1442,9 @@ void start_background_queue(void) exit(1); } + /* Track the printing pid along with other smbd children */ + add_child_pid(background_lpq_updater_pid); + if(background_lpq_updater_pid == 0) { struct tevent_fd *fde; int ret; |