Bug#887501: systemctl status should not use --pager

Michael Biebl biebl at debian.org
Wed Jan 17 13:59:07 GMT 2018


Am 17.01.2018 um 14:15 schrieb Guido Günther:
> Package: init-system-helpers
> Version: 1.51
> Severity: normal
> Tags: patch
> 
> Hi,
> systemctl status should be invoked with --no-pager, otherwise it might
> hang on non-interactive command. This was observed running serverspec's
> 
>    describe service('systemd-timesyncd') do
>      it { should be_running }
>    end
> 
> Possible patch attached.

Hm, I'm not quite convinced we should do this. service is supposed to be
a tool that is used interactively and I want it to behave as closely as
systemctl.

Second, for your use case, directly using
systemctl is-active $service
seems like a better idea anyway then to use a full-blown systemctl
status output as it would be much quicker.

Third, afaik, systemctl has some auto-detection whether it is called
from an interactive shell or not and is not supposed to use paging in
that case. Might be worth investigating if that is not working or if I'm
just misinformed there.

Fourght, you already have a knob where you can disable the pager. See
the systemctl man page → ENVIRONMENT. Setting $SYSTEMD_PAGER to an empty
var should disable the pager.

Given all those reasons, I don't think we should change the behaviour of
"service $foo status"



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20180117/657d1721/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list