M
M
mgkirs2014-05-02 15:57:53
linux
mgkirs, 2014-05-02 15:57:53

How to do an automatic server reboot?

Is there a tool to automatically reboot the server if the server crashes? I'm interested in the stability of the site on vps.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vlad Zhivotnev, 2014-05-04
@mgkirs

Read about monit, it will solve your problem.

K
Konstantin Kozhin, 2014-05-02
@kkzhn

In general, there should be such tools at the hypervisor level. However, they are unlikely to be available from inside the vps container. I have not met hosters that would provide an API to this mechanism on the hypervisor. Probably not for security reasons.
If you have access to a hypervisor (for example, you rent a physical server where you deployed a VPS), then you need to know which hypervisor you have.
And so you can monitor individual services on the VPS and restart them as needed using self-written scripts or specials. Software (for example, Zabbix). Of course, if the entire VPS "dies", this will not save the situation.

P
pomeo, 2014-05-02
@pomeo

Your approach is on the wrong side. Failures should be monitored and the causes of the failure eliminated.

I
Igor, 2014-05-02
@merryjane

If a failure is understood as kernel panic, then you can add the line to /etc/sysctl.conf:
kernel.panic = 3
then after kernel panic the system will automatically reboot after 3 seconds.
In other cases, it is necessary to monitor each service / daemon separately and already hang some handler on this monitoring.

S
Sergey, 2014-05-02
@edinorog

Depending on what is meant by failure. Sometimes it's better not to reboot the machine. Because it can do more damage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question