Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17761

Universal way to see if service/daemon is running?

$
0
0

I have set up a monitoring system called Nagios. I would like to see if a service/daemon is running on a linux server. since my linux servers is not always the same (Some use systemctl, some use init.d), i need an universal way of doing this. Like for processes I would use "ps aux | grep SomeProcess"

How do i best do this, in one single command that gives an exit code depending on the result?

submitted by _dev_random_
[link][23 comments]

Viewing all articles
Browse latest Browse all 17761

Trending Articles