Book Image

Webmin Administrator's Cookbook

By : Michal Karzynski
Book Image

Webmin Administrator's Cookbook

By: Michal Karzynski

Overview of this book

Table of Contents (19 chapters)
Webmin Administrator's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. Navigate to Others | System and Server Status.

  2. Click the link for the Apache Webserver monitor.

  3. 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.

  4. Click the Save button.

How it works...

Webmin creates a cron...