Re: nosh: convert-systemd-units' treatment of Standardxxx=tty directives

From: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups_at_NTLWorld.com>
Date: Tue, 24 May 2016 08:44:48 +0100

Guillermo:
> So, the convert-systemd-units tool recognizes the systemd 'StandardInput=tty' unit file directive, and translates it to a vc-get-tty + open-controlling-tty sequence in the 'run' file of the generated bundle directory. Which does more than just redirecting stdin to the appropriate character device file. Out of curiosity, why is the controlling terminal allocation done there? Is it just to respect systemd's behaviour, or is there a more fundamental reason?

It is to provide largely equivalent behaviour, yes. In 1.28,
forthcoming soon, you'll see that I spent a little time on this. Quirks
mode remains much the same. But in ideal mode there are some tweaks
with respect to the defaults, as well as a StandardError=log override.

Guillermo:
> I also note that, unlike the StandardInput case, 'StandardOutput=tty' and 'StandardError=tty' directives are not supported by the conversion tool and ignored with a warning, when it appears that in the absence of a 'StandardInput=tty' directive they could just be translated to an fdredir (or fdredir + fdmove --copy sequence) naming the device file. No controlling terminal required in this case according to the systemd documentation. And when 'StandardInput=tty' is present, 'StandardOutput=tty' (or 'inherit') and 'StandardError=tty' (or 'inherit') look already covered to me by the open-controlling-tty invocation, since that utility redirects stdout and stderr to the terminal, along with stdin. So, again out of curiosity, is there a reason for ignoring these uses of StandardOutput and StandardError?

It's an unusual case, that I haven't seen in the wild. The 1.28 changes
were partly to make ideal mode more normal but also partly in response
to things that I have seen. That, though, I have not. In practice,
service unit writers either want the like-a-ttylogin-service scenario --
setting the controlling terminal, allowing input, and all -- or they
push logs out to a log service. See
http://askubuntu.com/questions/770673/ for just one of many examples of
the former use case.
Received on Tue May 24 2016 - 07:44:48 UTC

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