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?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to