FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 06-17-2011, 09:41 PM
Martin Dengler
 
Default The behaviour of systemctl.

On Fri, Jun 17, 2011 at 10:16:35PM +0200, Aaron Sowry wrote:
> Hello,
>
> 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.

As you point out, git-log and --help do this too. It's excellent.
Make it configurable if you must, but I'd be interested to think why
you think it's not always the useful thing to do.

> All of these peculiarities stem from poor UNIX programming
> practise. Do not try to make decisions for me as a user (especially
> not based on output channels), about how I want my output formatted.

grep has had --color=auto for almost ten years[1].

> No other Linux/UNIX tools make this assumption (with perhaps the
> exception of git-log et. al.)

git and grep alone are a pretty significant set of tools, and I bet
there are others.

I agree with the rest of your objections about inconsistencies and
mistaken error handling. But the ship has sailed on stdout-is-tty
being an acceptable default driver of different output formatting.

Martin

1. http://cvs.savannah.gnu.org/viewvc/grep/grep/src/grep.c?view=diff&r1=1.69&r2=1.70




--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-17-2011, 10:06 PM
Aaron Sowry
 
Default The behaviour of systemctl.

n Fri, Jun 17, 2011 at 10:41:14PM +0100, Martin Dengler wrote:
> As you point out, git-log and --help do this too. It's excellent.
> Make it configurable if you must, but I'd be interested to think why
> you think it's not always the useful thing to do.

The reasons why it's not the useful thing to do were pointed out in my previous email.

> grep has had --color=auto for almost ten years[1].

Indeed - so why not use it, instead of, at least in the case of git-log, '--decorate'? At least then I can use grep with every output which needs 'decorating'.

> But the ship has sailed on stdout-is-tty
> being an acceptable default driver of different output formatting.

No ship has sailed anywhere, because there are plenty of places output can be sent en route to tty - 'watch' and 'egrep' are two examples. Also, tty is not the only place people want to send user-friendly input. What about files and printers?
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-17-2011, 11:31 PM
Jesse Keating
 
Default The behaviour of systemctl.

On 6/17/11 3:06 PM, Aaron Sowry wrote:
> No ship has sailed anywhere, because there are plenty of places
> output can be sent en route to tty - 'watch' and 'egrep' are two
> examples. Also, tty is not the only place people want to send
> user-friendly input. What about files and printers?

The apps that I've seen where they do something special like paging the
output by default, will not do that if the output is a non-active tty,
such as a pipe. When you pipe it into something it'll react differently.

--
Jesse Keating RHCE (http://jkeating.livejournal.com)
Fedora Project (http://fedoraproject.org/wiki/JesseKeating)
GPG Public Key (geek.j2solutions.net/jkeating.j2solutions.pub)
identi.ca (http://identi.ca/jkeating)
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2011, 08:46 AM
Aaron Sowry
 
Default The behaviour of systemctl.

On Fri, Jun 17, 2011 at 04:31:08PM -0700, Jesse Keating wrote:
> The apps that I've seen where they do something special like paging the
> output by default, will not do that if the output is a non-active tty,
> such as a pipe. When you pipe it into something it'll react differently.

Yes, and this is exactly the problem. When I run 'systemctl --all' on the tty, I get paging and column headers. When I pipe into something, I get no paging and no column headers. The assumption here is apparently that if the output is not going to tty then it is not destined for human eyes, which is an absolutely ridiculous assumption to make. If I output to a file so I can look at things later, I get no headers, and have no option to force them on non-tty output.

This alone may seem fairly trivial, but the problem is that there are many of these trivialities, all of which seem to stem from authors who either don't understand UNIX programming, or are actively choosing to ignore convention. Seriously, if anybody suggests that the solution to the above problem is to add a '--force-headers' flag, I think I'm going to start using Windows. We need to start having this discussion before more of this stupid behaviour starts finding its way into other core components of Fedora.

/Aaron
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2011, 10:02 AM
Ville Skyttä
 
Default The behaviour of systemctl.

On 06/18/2011 01:06 AM, Aaron Sowry wrote:
> n Fri, Jun 17, 2011 at 10:41:14PM +0100, Martin Dengler wrote:
>> As you point out, git-log and --help do this too. It's excellent.
>> Make it configurable if you must, but I'd be interested to think why
>> you think it's not always the useful thing to do.
>
> The reasons why it's not the useful thing to do were pointed out in my previous email.

I don't appreciate the default paging behavior at all either, but at
least git gives me an easy global way to get rid of it: export
GIT_PAGER=cat in ~/.bash_profile. systemctl does not seem to offer
anything comparable (remembering to type --no-pager or setting $PAGER
which affects other things do not count), or did I miss something?
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2011, 11:55 AM
Lennart Poettering
 
Default The behaviour of systemctl.

On Fri, 17.06.11 22:16, Aaron Sowry (aaron+rh@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.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2011, 12:00 PM
Lennart Poettering
 
Default The behaviour of systemctl.

On Sat, 18.06.11 10:46, Aaron Sowry (aaron+rh@aeneby.se) wrote:

> On Fri, Jun 17, 2011 at 04:31:08PM -0700, Jesse Keating wrote:
> > The apps that I've seen where they do something special like paging the
> > output by default, will not do that if the output is a non-active tty,
> > such as a pipe. When you pipe it into something it'll react differently.
>
> Yes, and this is exactly the problem. When I run 'systemctl --all' on
> the tty, I get paging and column headers. When I pipe into something,
> I get no paging and no column headers. The assumption here is
> apparently that if the output is not going to tty then it is not
> destined for human eyes, which is an absolutely ridiculous assumption
> to make. If I output to a file so I can look at things later, I get no
> headers, and have no option to force them on non-tty output.
>
> This alone may seem fairly trivial, but the problem is that there are
> many of these trivialities, all of which seem to stem from authors who
> either don't understand UNIX programming, or are actively choosing to
> ignore convention. Seriously, if anybody suggests that the solution to
> the above problem is to add a '--force-headers' flag, I think I'm
> going to start using Windows. We need to start having this discussion
> before more of this stupid behaviour starts finding its way into other
> core components of Fedora.

Supposedly non-UNIXy behaviour on Linux causes you to switch to Windows?
Yeah, that makes sense! Awesome logic!

Lennart

--
Lennart Poettering - Red Hat, Inc.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2011, 12:02 PM
Lennart Poettering
 
Default The behaviour of systemctl.

On Sat, 18.06.11 13:02, Ville Skyttä (ville.skytta@iki.fi) wrote:

>
> On 06/18/2011 01:06 AM, Aaron Sowry wrote:
> > n Fri, Jun 17, 2011 at 10:41:14PM +0100, Martin Dengler wrote:
> >> As you point out, git-log and --help do this too. It's excellent.
> >> Make it configurable if you must, but I'd be interested to think why
> >> you think it's not always the useful thing to do.
> >
> > The reasons why it's not the useful thing to do were pointed out in my previous email.
>
> I don't appreciate the default paging behavior at all either, but at
> least git gives me an easy global way to get rid of it: export
> GIT_PAGER=cat in ~/.bash_profile. systemctl does not seem to offer
> anything comparable (remembering to type --no-pager or setting $PAGER
> which affects other things do not count), or did I miss something?

Ask us nicely and we'll add SYSTEMD_PAGER for you, taking precedence
over PAGER.

Even more convincing might be prepping a patch for this.

Lennart

--
Lennart Poettering - Red Hat, Inc.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2011, 01:05 PM
Miloslav TrmaĨ
 
Default The behaviour of systemctl.

On Sat, Jun 18, 2011 at 1:55 PM, Lennart Poettering
<mzerqung@0pointer.de> wrote:
>> 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.

While much of "The UNIX way" is folklore, some conventions for the
(GNU/)Linux platform actually exist and have been explicitly
documented, and they haven't disappeared only because git happens to
ignore some of them. (info standards 'Program behavior' 'User
Interfaces')
Mirek
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2011, 02:15 PM
Ville Skyttä
 
Default The behaviour of systemctl.

On 06/18/2011 03:02 PM, Lennart Poettering wrote:

> Ask us nicely and we'll add SYSTEMD_PAGER for you, taking precedence
> over PAGER.
>
> Even more convincing might be prepping a patch for this.

https://bugs.freedesktop.org/show_bug.cgi?id=38439
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 12:08 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org