I am trying to get systemd to do what init.d scripts would do, showing the status of a service automatically after being manually given a command to start or stop. Is this somehow possible?
systemd unfortunately pops right back since it runs in the background and then you have to do a second command to show the status, the start or stop may or may not have worked, systemd will not tell you unless you ask and leave you blissfully ignorant.
ie. I am trying to get
service nginx status
to run automatically after I do a
service nginx start
or
service nginx restart
(or in brain damaged systemd, systemctl start nginx.service
)
Best Answer
There's no built-in command for your use-case so you'll have to make an alias for your favorite shell or a trivial script wrapper.