Asterisk shut down without reason

Hello, one of my asterisk systems shutdown with no reason, the machine do not shut down but the asterisk services do not works.

Any idea?

Is there any way to see if a service is running (in this case asterisk) and if it is not running restart it?

And I have other question (a stupid question, sure :smile: ). How can I do to load asterisk automatically whe the equipment start?

Thank you.

to see if asterisk is running type “ps axw | grep asterisk” without the quotes, this will list all running processes then pattern search the results for asterisk, that is assuming your running linux, if not you’ll need to ask someone who knows about your os. as for loading asterisk on startup you will probably use and init script in linux. if you installed with an rpm it should have made an init script you just have to turn it on. in redhat, fedora, or centOS you can use the command “ntsysv” don’t know about other linux distros but in those this will bring up a text-gui type thing that runs in the terminal and can controll what services start on startup, if asterisk was installed from an rpm this will get it started on startup. Hope I helped and didn’t just confuse you more.

Refer the below url . … d+Stopping

To start the asterisk at boot time u need to change the /etc/inittab file.

In the above url they gave some guide lines. try to follow those steps.

To check the asterisk process is running or not… use the following command which return the processid of the asterisk service.

ps -eaf | grep asterisk.

ps -eaf, why not axw?

Thank you, I will try this ideas. And any suggestion for use rpc to do it?