Re: s6-devd, stdin & stdout

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Sat, 07 Mar 2015 20:30:57 +0100

On 07/03/2015 18:37, Olivier Brunel wrote:
> Hi,
>
> I have a question regarding s6-devd: why does it set its stdin & stdout
> to /dev/null on start?

  Hi Olivier,
  The original purpose of s6-devd was actually to emulate the behaviour
of /proc/sys/kernel/hotplug, using the netlink to serialize calls instead
of having them all started in parallel.
  A helper program called by /proc/sys/kernel/hotplug would start with
stdin and stdout - and even stderr - set to /dev/null. That's where the
redirection in s6-devd comes from.

  Changing that behaviour means that a program that's used with s6-devd
is not guaranteed to be able to use as a /proc/sys/kernel/hotplug
helper if it performs I/O.

  But that's probably not important, so I can remove the stdout redirection,
it shouldn't be a problem - stderr is already non-redirected anyway.
  The stdin redirection, though, should stay: you don't want a hotplug
helper to depend on a state defined by streamed userland input.


> Specifically, the doc for s6-setuidgid says:
> "
> If account contains a colon, it is interpreted as uid:gid, else it is
> interpreted as a username and looked up by name in the account database.
> "
> This doesn't seem to be true (anymore?).

  Gah. I totally forgot about that change when rewriting s6-setuidgid.
Now that s6-applyuidgid exists, I really want to get rid of that
quirkiness... but it's my fault, so rather than removing the bit of
documentation, I'll reimplement the feature. Duh.

-- 
  Laurent
Received on Sat Mar 07 2015 - 19:30:57 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC