15

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

21

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
  • 3
    Any way to still get colored output from watch? Using -c doesn't seem to help Commented Dec 2, 2019 at 12:13
  • 7
    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
  • 4
    Thanks for the followup, makes for a nice alias: alias statuswatch='watch -c SYSTEMD_COLORS=1 systemctl status' Commented Dec 2, 2019 at 15:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.