The Samba-Bugzilla – Attachment 16311 Details for
Bug 14552
samba.service launches as a foreground process but doesn't tell systemd about its startup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for v4.13 branch
systemd-sd_notify-foreground-v4.13.patch (text/plain), 3.98 KB, created by
Alexander Bokovoy
on 2020-10-27 07:50:46 UTC
(
hide
)
Description:
patch for v4.13 branch
Filename:
MIME Type:
Creator:
Alexander Bokovoy
Created:
2020-10-27 07:50:46 UTC
Size:
3.98 KB
patch
obsolete
>From f960f93d586f494db400bd8fc110da7595992231 Mon Sep 17 00:00:00 2001 >From: Alexander Bokovoy <ab@samba.org> >Date: Sat, 24 Oct 2020 16:52:43 +0300 >Subject: [PATCH] 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) >--- > source3/nmbd/nmbd.c | 4 +++- > source3/smbd/server.c | 4 +++- > source3/winbindd/winbindd.c | 5 ++++- > source4/smbd/server.c | 4 +++- > 4 files changed, 13 insertions(+), 4 deletions(-) > >diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c >index 0b881d13f7b..f6aeba1f714 100644 >--- a/source3/nmbd/nmbd.c >+++ b/source3/nmbd/nmbd.c >@@ -1009,6 +1009,8 @@ static bool open_sockets(bool isdaemon, int port) > 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 >@@ -1135,7 +1137,7 @@ static bool open_sockets(bool isdaemon, int port) > exit_daemon( "NMBD failed to setup packet server.", EACCES); > } > >- if (is_daemon && !opt_interactive) { >+ if (!opt_interactive) { > daemon_ready("nmbd"); > } > >diff --git a/source3/smbd/server.c b/source3/smbd/server.c >index 3347519ea4f..39f83c3daa6 100644 >--- a/source3/smbd/server.c >+++ b/source3/smbd/server.c >@@ -1889,6 +1889,8 @@ extern void build_options(bool screen); > 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 >@@ -2096,7 +2098,7 @@ extern void build_options(bool screen); > exit_daemon("Samba cannot setup ep pipe", EACCES); > } > >- if (is_daemon && !interactive) { >+ if (!interactive) { > daemon_ready("smbd"); > } > >diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c >index 4397a1bc0d1..1e08237905a 100644 >--- a/source3/winbindd/winbindd.c >+++ b/source3/winbindd/winbindd.c >@@ -1880,8 +1880,11 @@ int main(int argc, const char **argv) > 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"); > >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"); > } > >-- >2.28.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
asn
:
review+
Actions:
View
Attachments on
bug 14552
: 16311