1

When I ran

$ sudo service td-agent status
● td-agent.service - td-agent: Fluentd based data collector for Treasure Data
   Loaded: loaded (/lib/systemd/system/td-agent.service; enabled; vendor preset: enabl
   Active: active (running) since Mon 2019-04-01 04:05:36 UTC; 6min ago
     Docs: https://docs.treasuredata.com/articles/td-agent
  Process: 7570 ExecStop=/bin/kill -TERM ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 7857 ExecStart=/opt/td-agent/embedded/bin/fluentd --log /var/log/td-agent/t
 Main PID: 7875 (fluentd)
    Tasks: 24 (limit: 2362)
   CGroup: /system.slice/td-agent.service
           ├─7875 /opt/td-agent/embedded/bin/ruby /opt/td-agent/embedded/bin/fluentd -
           └─7878 /opt/td-agent/embedded/bin/ruby /opt/td-agent/embedded/bin/fluentd -

Apr 01 04:05:35 ip-10-1-88-128 systemd[1]: Starting td-agent: Fluentd based data colle
Apr 01 04:05:36 ip-10-1-88-128 systemd[1]: Started td-agent: Fluentd based data collec
lines 1-14/14 (END)

It's not returning back and the cursor is beeping as a signal as if it's continuously checking the status.

Is it the fact?

I also tried with the following but it's not refreshing as I expected.

watch -n 10 sudo service td-agent status

Any help will be appreciated ;)

Hearen
  • 243
  • 1
  • 2
  • 11
  • Possibly related: [How do I exit the systemctl status command's output?](https://askubuntu.com/questions/961025/how-do-i-exit-the-systemctl-status-commands-output) – steeldriver Apr 01 '19 at 12:49
  • @steeldriver I am asking about how to **keep monitoring** the service status instead of "quit the command". I know how to quit it, I suppose. Thank you for the help, but would you please read the question for more details? – Hearen Apr 02 '19 at 00:29

1 Answers1

0

watch should work with systemctl, coloring enabled:

watch -c "sudo SYSTEMD_COLORS=1 systemctl status td-agent"

Source: https://unix.stackexchange.com/a/555179/15012