[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Thu Nov 11 15:35:02 UTC 2021


The branch, master has been updated
       via  57c1e115ece smbd: reopen logs on SIGHUP for notifyd and cleanupd
      from  06ed4ccba6c lib/cmdline: setup default file logging for servers

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


- Log -----------------------------------------------------------------
commit 57c1e115ecef41ef18599e5233079ccd83d13bfc
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jul 7 11:32:46 2020 +0200

    smbd: reopen logs on SIGHUP for notifyd and cleanupd
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Nov 11 15:34:28 UTC 2021 on sn-devel-184

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

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


Changeset truncated at 500 lines:

diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index d02ff1bd883..05592d0ef41 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -403,6 +403,7 @@ static void notifyd_sig_hup_handler(struct tevent_context *ev,
 {
 	DBG_NOTICE("notifyd: Reloading services after SIGHUP\n");
 	reload_services(NULL, NULL, false);
+	reopen_logs();
 }
 
 static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
@@ -410,10 +411,10 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
 {
 	struct tevent_context *ev = messaging_tevent_context(msg);
 	struct tevent_req *req;
+	struct tevent_signal *se = NULL;
 	pid_t pid;
 	NTSTATUS status;
 	bool ok;
-	struct tevent_signal *se;
 
 	if (interactive) {
 		req = notifyd_req(msg, ev);
@@ -570,6 +571,17 @@ static void notifyd_started(struct tevent_req *req)
 	}
 }
 
+static void cleanupd_sig_hup_handler(struct tevent_context *ev,
+				     struct tevent_signal *se,
+				     int signum,
+				     int count,
+				     void *siginfo,
+				     void *pvt)
+{
+	DBG_NOTICE("cleanupd: Reloading services after SIGHUP\n");
+	reopen_logs();
+}
+
 static void cleanupd_stopped(struct tevent_req *req);
 
 static bool cleanupd_init(struct messaging_context *msg, bool interactive,
@@ -577,6 +589,7 @@ static bool cleanupd_init(struct messaging_context *msg, bool interactive,
 {
 	struct tevent_context *ev = messaging_tevent_context(msg);
 	struct server_id parent_id = messaging_server_id(msg);
+	struct tevent_signal *se = NULL;
 	struct tevent_req *req;
 	pid_t pid;
 	NTSTATUS status;
@@ -647,6 +660,17 @@ static bool cleanupd_init(struct messaging_context *msg, bool interactive,
 		exit(1);
 	}
 
+	se = tevent_add_signal(ev,
+			       ev,
+			       SIGHUP,
+			       0,
+			       cleanupd_sig_hup_handler,
+			       NULL);
+	if (se == NULL) {
+		DBG_ERR("Could not add SIGHUP handler\n");
+		exit(1);
+	}
+
 	req = smbd_cleanupd_send(msg, ev, msg, parent_id.pid);
 	if (req == NULL) {
 		DBG_WARNING("smbd_cleanupd_send failed\n");


-- 
Samba Shared Repository



More information about the samba-cvs mailing list