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
if (is_daemon && !opt_interactive) {
DEBUG(3, ("Becoming a daemon.\n"));
become_daemon(Fork, no_process_group, log_stdout);
+ } else if (!opt_interactive) {
+ daemon_status("nmbd", "Starting process...");
}
#ifdef HAVE_SETPGID
exit_daemon( "NMBD failed to setup packet server.", EACCES);
}
- if (is_daemon && !opt_interactive) {
+ if (!opt_interactive) {
daemon_ready("nmbd");
}
if (is_daemon && !interactive) {
DEBUG(3, ("Becoming a daemon.\n"));
become_daemon(Fork, no_process_group, log_stdout);
+ } else {
+ daemon_status("smbd", "Starting process ...");
}
#ifdef HAVE_SETPGID
exit_daemon("Samba cannot setup ep pipe", EACCES);
}
- if (is_daemon && !interactive) {
+ if (!interactive) {
daemon_ready("smbd");
}
BlockSignals(False, SIGHUP);
BlockSignals(False, SIGCHLD);
- if (!interactive)
+ if (!interactive) {
become_daemon(Fork, no_process_group, log_stdout);
+ } else {
+ daemon_status("winbindd", "Starting process ...");
+ }
pidfile_create(lp_pid_directory(), "winbindd");
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. */
}
}
- if (opt_daemon) {
+ if (!opt_interactive) {
daemon_ready("samba");
}