summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2020-10-24 16:52:43 +0300
committerKarolin Seeger <kseeger@samba.org>2020-10-27 10:50:29 +0000
commitc4938561a97e55efd624694ea55ef7c1a46a350a (patch)
tree2f74cb0f3b846efe47b826eebc32ed7cb9cbeb75 /source4
parentff781ba4682ded42142ace6e8634fff57788819e (diff)
downloadsamba-c4938561a97e55efd624694ea55ef7c1a46a350a.tar.gz
daemons: report status to systemd even when running in foreground
When systemd launches samba services, the configuration we have in systemd service files expects that the main process (/usr/sbin/*) would use sd_notify() to report back its status. However, we only use sd_notify() when running become_daemon(). As a result, samba/smbd/winbindd/nmbd processes never report back its status and the status updates from other childs (smbd, winbindd, etc) are not accepted as we now have implied NotifyAccess=main since commit d1740fb3d5a72cb49e30b330bb0b01e7ef3e09cc This leads to a timeout and killing samba process by systemd. Situation is reproducible in Fedora 33, for example. Make sure that we have required status updates for all daemons in case we aren't runnning in interactive mode. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14552 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Oct 26 19:58:18 UTC 2020 on sn-devel-184 (cherry picked from commit 3e27dc4847bd35ca8914be087d5a8ca096510399) Autobuild-User(v4-13-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-13-test): Tue Oct 27 10:50:29 UTC 2020 on sn-devel-184
Diffstat (limited to 'source4')
-rw-r--r--source4/smbd/server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 95acb99b86c..ee2e7508bb3 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -648,6 +648,8 @@ static int binary_smbd_main(const char *binary_name,
if (opt_daemon) {
DBG_NOTICE("Becoming a daemon.\n");
become_daemon(opt_fork, opt_no_process_group, false);
+ } else if (!opt_interactive) {
+ daemon_status("samba", "Starting process...");
}
/* Create the memory context to hang everything off. */
@@ -931,7 +933,7 @@ static int binary_smbd_main(const char *binary_name,
}
}
- if (opt_daemon) {
+ if (!opt_interactive) {
daemon_ready("samba");
}