Date: Mon, 19 Sep 2016 17:11:00 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212829] daemon(8) using -P swallows signals such as SIGHUP instead of propagating them Message-ID: <bug-212829-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212829 Bug ID: 212829 Summary: daemon(8) using -P swallows signals such as SIGHUP instead of propagating them Product: Base System Version: 10.3-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: dch@skunkwerks.at When a service such as net-mgmt/riemann (java/clojure) is run under daemon(= 8), `service reload` sends the SIGHUP to the parent daemon(8) process instead of the managed child process. command=3D"/usr/sbin/daemon" command_args=3D"-f -c -r -P ${pidfile} \ ${riemann_java_home}/bin/java \ ${riemann_java_opts} ... If the -p flag is used instead, which would provide the child's PID, then `service restart` restarts the child, and not the parent daemon(8) process, which then tries to restart *another* child. messy. I can't see a way around this other than either not using daemon(8), or alternatively teaching daemon(8) in -P mode to propagate SIGHUP to the child process. # notes from irc 21:20 <dch> is it possible for daemon(8) to pass on the SIGHUP it receives = via `service $name reload` to the child? it feels like this should be possible somehow 21:24 <@cem> It would be possible 23:06 <RootWyrm> dch: thought it already did.. I might have a kludge that u= ses child_pidfile somewhat handy. 01:56 <dch> RootWyrm: I thought it did too, I looked at /usr.sbin/daemon/daemon.c and realise I am out of my depth here. 01:58 <dch> AFAICT the SIGHUP is only sent by service(8) to daemon, and dae= mon doesn't propagate it further, when using `command_args=3D"-f -c -r -P ${pid= file} =E2=80=A6 ` 01:59 <dch> I think I swapped from -p to -P because using -p causes servic= e(8) to stop/start the child pid, and the daemon process restarts it behind your back. 02:30 <RootWyrm> But yes, should depend on -p.. may need an -s flag to pass signal to -p ? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212829-8>
