10

Is there any option that allow watching the status of a systemd service in real time with systemctl

What I actually do:

systemctl status tor

For example:

systemctl watch tor

1 Answer 1

16

You could use the watch command to watch the output of systemctl status tor:

watch systemctl status tor

You can also follow the systemd logs for the service, which may also be useful:

journalctl -u tor -f
3
  • 2
    Any way to still get colored output from watch? Using -c doesn't seem to help
    – Panki
    Dec 2, 2019 at 12:13
  • 6
    Sure, you can use the -c option of watch to interpret ANSI colour sequences, and the variable SYSTEMD_COLORS=1 to force systemctl to output in colour. So the command would be watch -c SYSTEMD_COLORS=1 systemctl status tor Dec 2, 2019 at 13:50
  • 2
    Thanks for the followup, makes for a nice alias: alias statuswatch='watch -c SYSTEMD_COLORS=1 systemctl status'
    – Panki
    Dec 2, 2019 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.