13

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
france1
  • 45
  • 7
henriquehbr
  • 818
  • 2
  • 9
  • 28

1 Answers1

18

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
rusty shackleford
  • 2,365
  • 9
  • 21
  • 2
    Any way to still get colored output from `watch`? Using `-c` doesn't seem to help – Panki Dec 02 '19 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` – rusty shackleford Dec 02 '19 at 13:50
  • 2
    Thanks for the followup, makes for a nice alias: `alias statuswatch='watch -c SYSTEMD_COLORS=1 systemctl status'` – Panki Dec 02 '19 at 15:20