Send status to systemd on daemon start
authorMarcos Mello <marcosfrm@gmail.com>
Fri, 30 Nov 2018 11:25:07 +0000 (09:25 -0200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 17 Dec 2018 00:24:15 +0000 (01:24 +0100)
commit440ddf8470b11a46066d282bf8945201d547c192
tree6c05f09fecd28b1c247414a52fe09de450d6a337
parent97c5a698aa2ba99bc07c7db8bc12bfcb7afa662e
Send status to systemd on daemon start

systemd service files run in no-forking mode (--foreground) since
8b6f58194da7e849cdb9d20712dff49b17a93a77.

Rearrange sd_notify() call in become_daemon() to only send status to systemd
in this mode (Type=notify is not designed to monitor forking). Drop READY=0
(it does nothing) and MAINPID= (unnecessary because the process spawned by
systemd is already the main PID).

Also remove STATUS= prefix from debug messages.

Signed-off-by: Marcos Mello <marcosfrm@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/become_daemon.c