Guidelines

This site is for tech Q&A. Please keep your posts focused on the subject at hand.

Ask one question at a time. Don't conflate multiple problems into a single question.

Make sure to include all relevant information in your posts. Try to avoid linking to external sites.

Links to documentation are fine, but in addition you should also quote the relevant parts in your posts.

0 votes
1.0k views
1.0k views

By default Systemd shows service status output in less, which is not only annoying in interactive terminals, but may also interrupt scripts that display a service status (because you need to exit from the pager before the script can continue).

I tried changing/unsetting $PAGER and changing default less parameters ($LESS), but that didn't seem to have any effect.

How do I get rid of systemctl paging?

in Sysadmin
by (125)
3 20 38
edit history

Please log in or register to answer this question.

1 Answer

0 votes
 

systemctl can be called with a parameter --no-pager to avoid this behavior. However, that won't help when you're using the service command instead of systemctl (for portable scripts). As an alternative you can set the environment variable $SYSTEMD_PAGER to an empty value.

 export SYSTEMD_PAGER=

Setting the environment variable $PAGER to an empty value would also work, but would likely affect other applications as well, so I wouldn't recommend that.

by (125)
3 20 38
edit history
...