[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Jun 27 17:58:01 UTC 2019


The branch, master has been updated
       via  6e5bff80a0a s3:notifyd: Handle sigup in notifyd to reparse smb.conf
      from  9920aefd4e1 s4:torture: Use GnuTLS RC4 in rpc forest_trust test

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6e5bff80a0a0b5e999a9327640f3aa01b9f18777
Author: Shyamsunder Rathi <shyam.rathi at nutanix.com>
Date:   Fri May 17 18:34:04 2019 -0700

    s3:notifyd: Handle sigup in notifyd to reparse smb.conf
    
    At present, SIGHUP is blocked on notifyd. So, if parent smbd
    is started with "log level" 10 in smb.conf, and later changed
    to 0, the SIGHUP will not change the log level to 0 in notify
    smbd process and it will keep printing verbose logs in the
    corresponding log files.
    
    Proposed fix is to write a SIGHUP handler for notifyd and set
    it to reload services.
    
    Reviewed-by: Hemanth Thummala <hemanth.thummala at nutanix.com>
    Signed-off-by: Shyamsunder Rathi <shyam.rathi at nutanix.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by:Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jun 27 17:57:12 UTC 2019 on sn-devel-184

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/server.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 8a5d8e5dc05..0da29f7bab6 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -385,6 +385,17 @@ static void notifyd_stopped(struct tevent_req *req)
 	DEBUG(1, ("notifyd stopped: %s\n", strerror(ret)));
 }
 
+static void notifyd_sig_hup_handler(struct tevent_context *ev,
+				    struct tevent_signal *se,
+				    int signum,
+				    int count,
+				    void *siginfo,
+				    void *pvt)
+{
+	DBG_NOTICE("notifyd: Reloading services after SIGHUP\n");
+	reload_services(NULL, NULL, false);
+}
+
 static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
 			      struct server_id *ppid)
 {
@@ -393,6 +404,7 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
 	pid_t pid;
 	NTSTATUS status;
 	bool ok;
+	struct tevent_signal *se;
 
 	if (interactive) {
 		req = notifyd_req(msg, ev);
@@ -421,6 +433,17 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
 		exit(1);
 	}
 
+	/* Set up sighup handler for notifyd */
+	se = tevent_add_signal(ev,
+			       ev,
+			       SIGHUP, 0,
+			       notifyd_sig_hup_handler,
+			       NULL);
+	if (!se) {
+		DEBUG(0, ("failed to setup notifyd SIGHUP handler\n"));
+		exit(1);
+	}
+
 	req = notifyd_req(msg, ev);
 	if (req == NULL) {
 		exit(1);
@@ -428,7 +451,6 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
 	tevent_req_set_callback(req, notifyd_stopped, msg);
 
 	/* Block those signals that we are not handling */
-	BlockSignals(True, SIGHUP);
 	BlockSignals(True, SIGUSR1);
 
 	messaging_send(msg, pid_to_procid(getppid()), MSG_SMB_NOTIFY_STARTED,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list