[Bug 236117] /usr/sbin/daemon should support stdin,stdout,stderr redirect to files other than /dev/null

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 15 Jun 2024 10:13:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236117

Tatsuki Makino <tatsuki_makino@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tatsuki_makino@hotmail.com

--- Comment #3 from Tatsuki Makino <tatsuki_makino@hotmail.com> ---
Although it's also weird that I'm still using 12.4-STABLE... :)
I replaced /usr/sbin/daemon with one built using the 10.4-STABLE source code.
This is because the behavior of standard output and standard error output has
changed.

I used to use it as follows, but the current version, which specializes in log
output, changes in content.
daemon -p /tmp/daemon.pid cat /dev/somedevice > /tmp/output.dat

I had to update FreeBSD to 13 or 14, but I looked for a workaround to avoid
using daemon of version 10, and I got the following.
daemon -p /tmp/daemon.pid -m 0 -o /dev/null cat /dev/somedevice >
/tmp/output.dat

Setting -m to 0 is not in usage, but it prevents the two output descriptors of
the child process from switching to the log pipe.
Using the -o or -S options suppresses the output of the log to standard output.

It seems that stdin, stdout, and stderr will now be the same as when daemon is
started.
I finally got to it today :)

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