[PATCH] s3:notifyd: Handle sigup in notifyd to reparse smb.conf

Shyam Rathi shyam.rathi at nutanix.com
Fri May 24 00:18:36 UTC 2019


Thanks for the review Jeremy. Responses inline below.


Regards,
-Shyam

From: Jeremy Allison <jra at samba.org>
Reply-To: Jeremy Allison <jra at samba.org>
Date: Thursday, May 23, 2019 at 5:04 PM
To: Shyam Rathi <shyam.rathi at nutanix.com>
Cc: "samba-technical at lists.samba.org" <samba-technical at lists.samba.org>
Subject: Re: [PATCH] s3:notifyd: Handle sigup in notifyd to reparse smb.conf

On Sun, May 19, 2019 at 02:46:29AM +0000, Shyam Rathi via samba-technical wrote:
Hello,
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.
Please review the attached patch for suggestions and comments.

Hi Shyamsunder,

A few comments.

In notifyd_sig_hup_handler().

+       DEBUG(2,("notifyd: Reloading services after SIGHUP\n"));

	^^^^
	Please use either the DBG_WARNING or DBG_NOTICE macros
	to ensure consistency in new debug info levels.

		---- I'll make the change.

+       become_root();
+       reload_services(NULL, NULL, false);
+       unbecome_root();

	^^^^^^^

Does notifyd need become_root()/unbecome_root()
pairs ? Isn't it always invoked when smbd is root
and stays as such ?

		---- The sighup handler for parent smbd calls
			"change_to_root_user()" before calling
			reload_services(). For many other binaries,
			either reload_services() or (un)become_root
			is called first. I mainly kept the same
			behavior. I'm not fully sure about its purpose
			at this place.

The rest of this looks fine ! Thanks a *lot*
for your help.

Jeremy.




More information about the samba-technical mailing list