Tell systemd to output every command it executes for a unit

Phuong Nguyen asked:

I’m trying to run some Docker container on coreos. However, I’m getting some error and is clueless about what went wrong.

What I did is to use journalctl -f -u myunit.service to view the log in realtime, and then use systemctl start myunit.service and systemctl stop myunit.service to trigger the action, however I don’t see any thing details enough to understand what’s going on.

I would like systemd to output all commands it execute while it starts or stops my unit. What should I do?

My answer:

Run systemctl status myunit.service and you will see the commands that were run, and their status.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.