The behaviour of systemctl.

Lennart Poettering mzerqung at 0pointer.de
Sat Jun 18 11:55:43 UTC 2011


On Fri, 17.06.11 22:16, Aaron Sowry (aaron+rh at aeneby.se) wrote:

> Hello,

Heya,

> I'd like to discuss the behaviour of systemctl. See RH bug 713567 for context. To summarise:
> 
> - 'systemctl --all' pages by default when the output is to tty. This
>   consumes 50-60+ lines of potentially bug-prone code, and irks the
>   crap out of me as a system administrator. systemctl's jurisdiction
>   ends at stdout.

Well, I think in genreal the autopaging behaviour of git and other tools
is very much appreciated. If you hate that behaviour then you are
probably in the minority, and we have to agree to disagree on the
benefits of this behaviour. Setting "alias systemctl='systemctl
--no-pager'" is not particularly hard though.

> - The same command outputs column headers on tty, and no headers
>   otherwise. This is inconsistent. If I am outputting to a file, or
>   perhaps a printer, and want headers on my non-tty output, I have to
>   add them myself since there is no flag to force them on non-tty
>   channels. If I don't want them and they are present, I tail.

I am pretty sure that if you ask us nicely, we'll add an option to
enable headers nonetheless. It's however usually simpler if you pipe
something not to have to use tail/head.

> - Currently, if I run 'systemctl --all' and have no pager (at least no
>   pager that systemctl knows of) available, I get an error message and
>   no output. This is horribly bad form, and forces me to use
>   --no-pager or pipe to cat in order to get output. This issue is
>   acknowledged in RH bug 713707.

We generally do not support if people delete arbitrary things from their
installation. /bin/more is part of util-linux, and if you delete that
then you broke your system, so don't complain to us please.

I am not saying we shouldn't make it possible to run without any pager
installed. But does this matter? No, not at all. It doesn't have
priority in any way.

It's probably one of those cases where supplying us with a clean,
minimal patch is the most compelling argument to make your
point. Complaining on mailing lists not so much.

> - Another bright idea (RH bug 713567) is that --full should be applied
>   to non-tty output automatically, and not to tty output.

Yes, it actually makes sense and has been requested which is why we
implemented it.

> All of these peculiarities stem from poor UNIX programming
> practise. 

I think all of these "peculiarities" stem from actually accepting
progress.

> No other Linux/UNIX tools make this assumption (with
> perhaps the exception of git-log et. al.), and if you are wanting
> administrators to feel comfortable with your new soon-to-be-ubiquitous
> tools, then I suggest you try to be consistent with existing
> convention. 

I think you are mixing up "administrators" with "Aaron Sowry".

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the devel mailing list