On Fedora 35 running Samba 4.15.3, it appears that /usr/libexec/samba/samba-bgqd still emits notifications to systemd, which since commit d1740fb3 are expected to come only from the main process. This results in messages like this in the systemd journal: systemd[1]: smb.service: Got notification message from PID 2162, but reception only permitted for main PID 1779 Where PID 1779 is the initial smbd process, and PID 2162 is a spawned instance of /usr/libexec/samba/samba-bgqd Similar issues were already addressed for other services, such as samba-ad-dc, in this MR: https://gitlab.com/samba-team/samba/-/merge_requests/1813 However, it doesn't appear that samba-bgqd was covered by those fixes. Reinserting "NotifyAccess=all" into the smb.service systemd configuration is effective as a workaround, but obviously the intent with commit d1740fb3 was for that to no longer be required.
Thank you, Frank. Could you please submit an MR?
(In reply to Alexander Bokovoy from comment #1) I could submit an MR adding "NotifyAccess=all" back into the systemd unit file, but my impression is that's not how the Samba devs want to approach this. Like I said, its removal was a deliberate act. When other issues like this have cropped up, their response has been to correct the daemons involved so that they no longer notify systemd. So, that's what I would characterize as the "correct" fix, as opposed to "NotifyAccess=All" which would be a workaround and a step backwards in terms of the Samba systemd configuration. But beyond the high-level description of the fix I just gave, I'm afraid I have no idea how to actually fix this issue correctly... or even where exactly it would need to be fixed.
(In reply to Frank Dana from comment #2) > (In reply to Alexander Bokovoy from comment #1) > > I could submit an MR adding "NotifyAccess=all" back into the systemd unit > file, but my impression is that's not how the Samba devs want to approach > this. Like I said, its removal was a deliberate act. When other issues like > this have cropped up, their response has been to correct the daemons > involved so that they no longer notify systemd. Sorry for being too concise in my request. ;) I asked to submit a change to samba-bgqd in the same way as https://gitlab.com/samba-team/samba/-/merge_requests/1813 did for others. E.g. in case we are running in the configuration that expects launching samba-bgqd off existing samba processes, add daemon_sd_notifications(false); to the samba-bgqd startup.
(In reply to Alexander Bokovoy from comment #3) Ah, I see! That I can do, looks like the only thing that matters is that daemon_sd_notifications(false) get called before become_daemon(). Straightforward enough. (The documentation comment for daemon_sd_notifications() is a bit odd:) /** * @brief Enable or disable daemon status systemd notifications * * When samba runs as AD DC only the main 'samba' process has to * notify systemd. Child processes started by the main 'samba', like * smbd and winbindd should call this function to disable sd_notify() * calls. * * @param[in] enable True to enable notifications, false to disable **/ Doesn't seem like Active Directory has anything to do with it, really.
Opened: https://gitlab.com/samba-team/samba/-/merge_requests/2346
This bug was referenced in samba master: 36c861e25b1d9c5ce44bfcb46247e7e4747930c5
Created attachment 17131 [details] patch for 4.16
Created attachment 17132 [details] patch for 4.15
Comment on attachment 17131 [details] patch for 4.16 LGTM
Comment on attachment 17132 [details] patch for 4.15 LGTM
Jule, could you please apply the patches to the corresponding branches? Thanks!
Pushed to autobuild-v4-{16,15}-test.
This bug was referenced in samba v4-15-test: 82799c1f86d966be47bc7de29e8c7f0cd574b7c9
This bug was referenced in samba v4-16-test: c4132ef482bc2a3a20742cfdc5b524bedc8c445b
Closing out bug report. Thanks!
This bug was referenced in samba v4-16-stable (Release samba-4.16.0rc2): c4132ef482bc2a3a20742cfdc5b524bedc8c445b
This bug was referenced in samba v4-15-stable (Release samba-4.15.6): 82799c1f86d966be47bc7de29e8c7f0cd574b7c9