systemd: Start processes in forground and without a process group
authorAndreas Schneider <asn@samba.org>
Fri, 10 Nov 2017 08:32:27 +0000 (09:32 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 28 Nov 2017 14:31:27 +0000 (15:31 +0100)
We should not double fork in notify mode or systemd think something
during startup will be wrong and send SIGTERM to the process. So
sometimes the daemon will not start up correctly.

systemd will also handle the process group.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13129

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 28 15:31:27 CET 2017 on sn-devel-144

packaging/systemd/nmb.service
packaging/systemd/samba.service
packaging/systemd/smb.service
packaging/systemd/winbind.service

index 992c0cd..71c93d6 100644 (file)
@@ -7,7 +7,7 @@ Type=notify
 NotifyAccess=all
 PIDFile=/run/nmbd.pid
 EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
+ExecStart=/usr/sbin/nmbd --foreground --no-process-group $NMBDOPTIONS
 ExecReload=/usr/bin/kill -HUP $MAINPID
 LimitCORE=infinity
 
index 824f89c..1b64c3b 100644 (file)
@@ -8,7 +8,7 @@ NotifyAccess=all
 PIDFile=/run/samba.pid
 LimitNOFILE=16384
 EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/samba $SAMBAOPTIONS
+ExecStart=/usr/sbin/samba --foreground --no-process-group $SAMBAOPTIONS
 ExecReload=/usr/bin/kill -HUP $MAINPID
 
 [Install]
index 6053a5c..adf6684 100644 (file)
@@ -8,7 +8,7 @@ NotifyAccess=all
 PIDFile=/run/smbd.pid
 LimitNOFILE=16384
 EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/smbd $SMBDOPTIONS
+ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS
 ExecReload=/usr/bin/kill -HUP $MAINPID
 LimitCORE=infinity
 
index c511488..46b3797 100644 (file)
@@ -7,7 +7,7 @@ Type=notify
 NotifyAccess=all
 PIDFile=/run/winbindd.pid
 EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/winbindd "$WINBINDOPTIONS"
+ExecStart=/usr/sbin/winbindd --foreground --no-process-group "$WINBINDOPTIONS"
 ExecReload=/usr/bin/kill -HUP $MAINPID
 LimitCORE=infinity