Send status to systemd on daemon start
authorMarcos Mello <marcosfrm@gmail.com>
Fri, 30 Nov 2018 11:25:07 +0000 (09:25 -0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 26 Mar 2019 07:49:17 +0000 (07:49 +0000)
commit7b52da5ecdc43c2876e0e500302a8590714b0c95
treeca6d6fd762d431eb56c0a7394f80086bd8909a16
parentd3e306433f7be4f0d190884ba078cd39d02ab318
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