Automatically restarting a service that goes down
Webmin's monitoring functionality can alert you to problems detected on your system, but it can also automatically react to detected problems by executing commands. For instance, if a service goes down, you can try to restart it automatically.
Getting ready
This recipe is an extension of the previous one, Receiving e-mail when a service stops running. Make sure you follow the setup steps in that recipe before you start this one.
In this recipe, we'll tell Webmin to monitor Apache and restart it automatically if it stops running.
How to do it...
Follow these steps to automatically restart a service that goes down:
Navigate to Others | System and Server Status.
Click the link for the Apache Webserver monitor.
In the Commands to run section, enter the command to start Apache in the If monitor goes down, run command text field. The command on most Linux distributions is
service apache2 start
.Click the Save button.
How it works...
Webmin creates a cron...