The Samba-Bugzilla – Attachment 14964 Details for
Bug 11568
'STATUS=' in debug messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.9 and 4.8
v4-9-fix-smbd-sdnotify.patch (text/plain), 2.61 KB, created by
Andreas Schneider
on 2019-03-20 17:21:51 UTC
(
hide
)
Description:
patch for 4.9 and 4.8
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2019-03-20 17:21:51 UTC
Size:
2.61 KB
patch
obsolete
>From ebe5b1b1b2256090e9fe8f41ecf5b9e2fc497b27 Mon Sep 17 00:00:00 2001 >From: Marcos Mello <marcosfrm@gmail.com> >Date: Fri, 30 Nov 2018 09:25:07 -0200 >Subject: [PATCH] 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) >--- > lib/util/become_daemon.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > >diff --git a/lib/util/become_daemon.c b/lib/util/become_daemon.c >index 232eda69b64..89991b7981c 100644 >--- a/lib/util/become_daemon.c >+++ b/lib/util/become_daemon.c >@@ -73,14 +73,12 @@ void become_daemon(bool do_fork, bool no_session, bool log_stdout) > exit_daemon("Fork failed", errno); > } > if (newpid) { >-#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD) >- sd_notifyf(0, >- "READY=0\nSTATUS=Starting process...\n" >- "MAINPID=%lu", >- (unsigned long) newpid); >-#endif /* HAVE_LIBSYSTEMD_DAEMON */ > _exit(0); > } >+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD) >+ } else { >+ sd_notify(0, "STATUS=Starting process..."); >+#endif > } > > /* detach from the terminal */ >@@ -120,7 +118,7 @@ void exit_daemon(const char *msg, int error) > msg, > error); > #endif >- DBG_ERR("STATUS=daemon failed to start: %s, error code %d\n", >+ DBG_ERR("daemon failed to start: %s, error code %d\n", > msg, error); > exit(1); > } >@@ -134,7 +132,7 @@ void daemon_ready(const char *daemon) > sd_notifyf(0, "READY=1\nSTATUS=%s: ready to serve connections...", > daemon); > #endif >- DBG_ERR("STATUS=daemon '%s' finished starting up and ready to serve " >+ DBG_ERR("daemon '%s' finished starting up and ready to serve " > "connections\n", daemon); > } > >@@ -144,7 +142,7 @@ void daemon_status(const char *daemon, const char *msg) > daemon = "Samba"; > } > #if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD) >- sd_notifyf(0, "\nSTATUS=%s: %s", daemon, msg); >+ sd_notifyf(0, "STATUS=%s: %s", daemon, msg); > #endif >- DBG_ERR("STATUS=daemon '%s' : %s\n", daemon, msg); >+ DBG_ERR("daemon '%s' : %s\n", daemon, msg); > } >-- >2.21.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:
ab
:
review+
Actions:
View
Attachments on
bug 11568
:
13939
|
13947
|
14960
|
14961
| 14964