In a shell script, how can I test if a service is up and running? Is there a quick way? Or just use pgrep?
Not sure what you are looking for but the systemctl status {service-name}
is the built in tool for checking services.
1 Like
systemctl is-active $servicename
will probably do what you need.
2 Likes
Fantastic, I am having problems with greenclip on openbox, so:
systemctl is-active --user greenclip
Does it.
:edit: read what you paste you numpty (me!).
4 Likes