The samba daemons should not double fork when started by systemd. The problem in notify mode if we double fork, systemd is sending SIGTERM to the process so the startup fails. They need to be started with -foreground and --no-process-group. The 'samba' binary doesn't support that yet. Patches will follow.
Take care (and example) of how selftest.pl starts Samba. It would be great if this was more consistent, without breaking existing configurations.
Created attachment 13816 [details] patch for 4.7
Created attachment 13817 [details] patch for 4.7
Comment on attachment 13817 [details] patch for 4.7 LGTM
Karolin, please add the patch to 4.7. Thanks.
(In reply to Andreas Schneider from comment #6) Pushed to autobuild-v4-7-test.
(In reply to Karolin Seeger from comment #7) Patch breaks the build: [2010/4210] Compiling source4/smbd/server.c ../source4/smbd/server.c: In function ‘binary_smbd_main’: ../source4/smbd/server.c:454:27: error: ‘opt_no_process_group’ undeclared (first use in this function) become_daemon(opt_fork, opt_no_process_group, false); ^ ../source4/smbd/server.c:454:27: note: each undeclared identifier is reported only once for each function it appears in Waf: Leaving directory `/memdisk/kseeger/a47/b1867796/samba/bin' Re-assigning to Andreas.
Created attachment 13821 [details] patch for 4.7 Ups, the patchset is two small. Two commits missing. Correct version is attached now. Sorry.
Comment on attachment 13821 [details] patch for 4.7 Ok, looks good now.
Karolin, this time it should work :-)
(In reply to Andreas Schneider from comment #11) Patchset does not apply on current v4-7-test branch. The last patch "systemd: Start processes in forground and without a process group" has already been pushed (I only removed the patch that broke the build obviously). Now I pushed your patch after removing the last patch to autobuild-v4-7-test. To be on the safe side, please double-check. Thanks!
*** Bug 10801 has been marked as a duplicate of this bug. ***
Created attachment 13875 [details] possible patch for master
Created attachment 13878 [details] Backport regression fix for 4.7
Please take the additional patch for 4.7
(In reply to Andrew Bartlett from comment #16) Pushed additional patch to autobuild-v4-7-test.
Pushed to v4-7-test. Closing out bug report. Thanks!
Created attachment 13940 [details] Small systemd fix Now that --foreground is default in service files, fix status message passing to systemd.
Marcos, please open a new bug for this and you need to sign-off the patch, see README.Contributing. Andreas