The Samba-Bugzilla – Attachment 13948 Details for
Bug 13253
Send status message to systemd on daemon start
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix
0001-Signal-systemd-on-daemon-start.patch (text/plain), 1.45 KB, created by
Marcos Mello
on 2018-02-08 10:27:53 UTC
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Marcos Mello
Created:
2018-02-08 10:27:53 UTC
Size:
1.45 KB
patch
obsolete
>From 6f9f80c11284ec3e4a2fdb81a60b5167a6026dd2 Mon Sep 17 00:00:00 2001 >From: Marcos Mello <marcosfrm@gmail.com> >Date: Wed, 7 Feb 2018 07:55:42 -0200 >Subject: [PATCH] Signal systemd on daemon start > >systemd service files run in no forking mode (--foreground) since >8b6f58194da7e849cdb9d20712dff49b17a93a77. > >Rearrange sd_notify() call in become_daemon() to only signal systemd in this >mode (Type=notify is not designed to monitor double forking). Also drop READY=0 >(it does nothing) and MAINPID= (unnecessary because the process spawned by >systemd is already the main PID). > >Signed-off-by: Marcos Mello <marcosfrm@gmail.com> >--- > lib/util/become_daemon.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > >diff --git a/lib/util/become_daemon.c b/lib/util/become_daemon.c >index 232eda69b64..3b6a4bb11ed 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 /* HAVE_LIBSYSTEMD_DAEMON */ > } > > /* detach from the terminal */ >-- >2.16.1 >
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
Actions:
View
Attachments on
bug 13253
: 13948