[systemd-devel] systemd's connections to /run/systemd/private ?

Dave Howorth systemd at howorth.org.uk
Wed Aug 14 19:38:14 UTC 2019


On Wed, 14 Aug 2019 12:04:03 -0400
Brian Reichert <reichert at numachi.com> wrote:
> On Wed, Aug 14, 2019 at 04:19:46PM +0100, Simon McVittie wrote:
> > On Wed, 14 Aug 2019 at 10:26:53 -0400, Brian Reichert wrote:
> > Doesn't daemonize(1) make stdin, stdout and stderr point
> > to /dev/null, instead of closing them?  
> 
> Looking at the source, yes, it does.
> 
> > Expecting arbitrary subprocesses to cope gracefully with being
> > invoked without the three standard fds seems likely to be a losing
> > battle. I've implemented this myself, in dbus; it isn't a whole lot
> > of code, but it also isn't something that I would expect the
> > authors of all CLI tools to get right.  
> 
> I concede that reopening FD 0,1,2 is a good practice to insulate
> against the issues you cite.
> 
> I agree with your points; I code aggressively, and sometimes forget
> others don't.

I didn't know what you meant by this. Do you mean 'Aggressive
Programming'? Is
https://www.apharmony.com/software-sagacity/2014/10/principles-of-aggressive-programming/
a reasonable summary?

> >     smcv
> > 
> > [1] I'm sure there are lots of other executables named daemon or
> > daemonize in other OSs, and perhaps some of them get this wrong?
> 
> -- 
> Brian Reichert				<reichert at numachi.com>
> BSD admin/developer at large	


More information about the systemd-devel mailing list