diff options
author | Jeremy Allison <jra@samba.org> | 1997-12-24 09:30:56 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1997-12-24 09:30:56 +0000 |
commit | 6a3cb6f4b46129e4d799a24d34cdb9460ed8910f (patch) | |
tree | 89e65dba89eec393182c994c446e70ebf26b3bb3 /source/nmbd/nmbd.c | |
parent | f7591109b968c66012af5e9fe818bba8e6f1cf23 (diff) | |
download | samba-6a3cb6f4b46129e4d799a24d34cdb9460ed8910f.tar.gz samba-6a3cb6f4b46129e4d799a24d34cdb9460ed8910f.tar.xz samba-6a3cb6f4b46129e4d799a24d34cdb9460ed8910f.zip |
Added SIGUSR1/SIGUSR2 handling.
Sending nmbd/smbd a SIGUSR1 will raise the debug level by one (capped at 10)
sending a SIGUSR2 will lower it (lower limit at zero).
Jeremy.
Diffstat (limited to 'source/nmbd/nmbd.c')
-rw-r--r-- | source/nmbd/nmbd.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index da98fbfde3a..744942ba464 100644 --- a/source/nmbd/nmbd.c +++ b/source/nmbd/nmbd.c @@ -75,11 +75,11 @@ static int sig_term() announce_my_servers_removed(); exit(0); + /* Keep compiler happy.. */ return 0; } /* sig_term */ - /**************************************************************************** ** catch a sighup **************************************************************************** */ @@ -577,6 +577,17 @@ int main(int argc,char *argv[]) signal( SIGHUP, SIGNAL_CAST sig_hup ); signal( SIGTERM, SIGNAL_CAST sig_term ); + /* Setup the signals that allow the debug log level + to by dynamically changed. */ + +#if defined(SIGUSR1) + signal( SIGUSR1, SIGNAL_CAST sig_usr1 ); +#endif /* SIGUSR1 */ + +#if defined(SIGUSR2) + signal( SIGUSR2, SIGNAL_CAST sig_usr2 ); +#endif /* SIGUSR2 */ + while((opt = getopt(argc, argv, "as:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:")) != EOF) { switch (opt) @@ -755,8 +766,14 @@ int main(int argc,char *argv[]) exit(1); } - /* We can only take sigterm signals in the select. */ + /* We can only take signals in the select. */ BlockSignals( True, SIGTERM ); +#if defined(SIGUSR1) + BlockSignals( True, SIGUSR1); +#endif /* SIGUSR1 */ +#if defined(SIGUSR2) + BlockSignals( True, SIGUSR2); +#endif /* SIGUSR2 */ process(); close_sockets(); |