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 992c0cd9d2b863f99b630791a9279a8a01fab172..71c93d6088b4b85eb93c6d8df8ecf514b87fac98 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 824f89c203036a743ef1a4c59174187d934c450d..1b64c3b779ddc4f00c5db513a629b2308eabd8bb 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 6053a5caaa5da2d1e3ba4785f529e671e991685b..adf6684c7d907524685ef6711b045b92a63b9efa 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 c511488166e87558203ec127f5c6a45f4cf69417..46b3797251dc362695abc1bd2c40032d8461d953 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