[Toybox] watchdog: Can't call daemon() on nommu
Rob Landley
rob at landley.net
Thu Oct 22 15:49:27 PDT 2020
On 10/21/20 4:24 AM, Patrick Oppenlander wrote:
> Sure, but..
>
> $ watchdog -F &
>
> works on nommu
So I'm poking at a vfork() based xvdaemon() with nommu support, and the ONLY
caller of daemon() without 0,0 arguments is watchdog.
I think not closing stdin/stdout/stderr is irrelevant here (it doesn't use them
afterwards? Do you WANT it to stay attached to the tty in -F mode?), but the no
chroot("/") is my question:
Do you want to support relative DEV arguments in the watchdog command? Because
if not, I can just make xvdaemon() take no arguments and unconditionally do
both, which is what every other caller wants so far.
(The error handling is a pain, because we closed stdin/stdout/stderr so HOW do
we report errors afterwards... open /dev/tty I guess... but the other thing is
the vfork() flow control requires restarting from command_main() each time so
the caller of xvdaemon() has to be aware of this. The command restarts when it's
called, but the second call returns rather than restarting. So I have to audit
each caller while converting, and remove some of the depends on TOYBOX_FORK
annotations from the commands...)
Rob
More information about the Toybox
mailing list