L
L
Luan2021-06-01 12:16:30
FreeSWITCH
Luan, 2021-06-01 12:16:30

CentOS 6.8. How to add autostart to a service?

I got a virtual machine, from an old system administrator, with CentOS 6.8 it has a freeswitch on it. Service keeps dropping. you have to restart it manually with the command: service freeswitch restart. Actually a noob question: how can I set an automatic restart after a service crash? I'm not good with Linux, but I've never used CentOS at all.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Syomov, 2021-06-01
@kotomyava

You can use monit to monitor the service and restart it.
But it is better to understand why it falls.

P
partisan42, 2021-06-01
@partisan42

The easiest way is to add service freeswitch start to cron and run it once a minute.
You can roll the zabbix agent onto this machine, and on the server already monitor the state of the daemon, and if it falls, start it on a trigger. But that's probably overkill.
In general, if you had a newer CentOS, there would already be systemd, where this issue is solved much more gracefully :)
But it is important to remember that all this is crutches, and you need to look for the cause of the daemon's fall for good.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question