Asterisk status

Here is one silly question.
i have difficulty to find out whether asterisk is running or not in ubuntu server.
there is no option like -service asterisk status.
so that i can catch this message to do further process. i don’t need any other information or asterisk CLI. i need only “asterisk is running or not” massage.

You can look the init.d script to see how it does the test.

The easiest way to check if asterisk is running , is with this command pgrep asterisk if you dont see any output asterisk is not running, If is running it will return the Asterisk process ID


pgrep asterisk worked for me.