Send status to systemd on daemon start
commit1e40887120df338d3b865599ff52b5ec176b64f3
authorMarcos Mello <marcosfrm@gmail.com>
Fri, 30 Nov 2018 11:25:07 +0000 (30 09:25 -0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 22 Mar 2019 09:55:33 +0000 (22 09:55 +0000)
tree47c834750de0dbad77a65ecb11590fdb76ac5e4e
parentfc40f87ebbc7c24190b3044f045e3e0d20e80889
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>
(cherry picked from commit 440ddf8470b11a46066d282bf8945201d547c192)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11568
lib/util/become_daemon.c