14

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

19

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
    Commented 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 Commented Dec 2, 2019 at 13:50
  • 3
    Thanks for the followup, makes for a nice alias: alias statuswatch='watch -c SYSTEMD_COLORS=1 systemctl status'
    – Panki
    Commented Dec 2, 2019 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .