add check to see if mysqld is running in init script
[monitor.git] / nagios / monitor-nagios.init
index 1b390fd..ebab5b8 100644 (file)
 # NOTE: expect that mysqld is already started.
 
 start () {
+       
+       if ! $( mysqladmin ping 2> /dev/null ) ; then
+               echo "mysqld is not running; cannot continue; exit..."
+               exit
+       fi
 
        # if it's a fresh install, there is no root passwd.
        if $( mysqladmin -u root create nagios ) ; then