[Bug 212829] daemon(8) using -P swallows signals such as SIGHUP instead of propagating them

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Sep 19 22:02:40 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212829

prj at rootwyrm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |prj at rootwyrm.com

--- Comment #1 from prj at rootwyrm.com ---
To elaborate on my general thoughts;

The issue with just passing signals through daemon is: what if we want to
signal daemon? Whoops. The other possibility is to use uncommonly used signals
but then all you've got is SIGUSR1 and SIGUSR2 without violating sanity.
Obviously, that is not an acceptable solution either. 
So my thought is that a user who wishes for daemon(8) to pass signals to the
child needs to provide two explicit arguments at runtime. First, the existing
child pid argument -p. Second, the flag -s 'signal passing.' This would tell
daemon to simply pass through all signals verbatim to the PID contained within
-p. (-s would conflict with -r as well.) This means it's an explicit
user-initiated behavior change, rather than function change.

Obviously, this then presents the problem: how to signal daemon itself. That I
do not have an elegant solution for. My initial thought was to have a socket
equivalent to -P where the user could simply echo the desired signal number to.
e.g. "echo '9' > /var/run/daemon/234.pid" - which isn't exactly optimal either.
However, this might be a more workable solution for child signalling perhaps?

Thoughts and feedback definitely appreciated.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list