This is the script I use to monitor and automatically restart when Webmin is no longer running. I made some changes so it will work on my Ubuntu server.
Create the script and copy contents below in /usr/local/src
vi webmin.chk #!/bin/bash if /etc/init.d/webmin status | grep "stopped" >/dev/null then echo "Webmin is stopped. Restarting..." /etc/init.d/webmin start else echo "Webmin is running." fi
Make the file executable. chmod +x webmin.chk
Go to Server and System Status menu.
Choose Webmin Server. Use the following settings below add and an email address where to send the notification.
After manually stopping Webmin I received the email below the auto restart script is being run by Server and System status monitor.