add check to see if mysqld is running in init script
authorStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 18 Jun 2010 23:05:43 +0000 (23:05 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 18 Jun 2010 23:05:43 +0000 (23:05 +0000)
Monitor.spec
nagios/monitor-nagios.init

index ac97879..8d9ede0 100644 (file)
@@ -177,8 +177,6 @@ rsync -a --exclude .svn  ./monitor/   $RPM_BUILD_ROOT/%{python_sitearch}/monitor
 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
 
 # TODO: 
-echo " * TODO: Setting up Monitor account in local MyPLC"
-
 #touch $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
 #chmod 777 $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
 
@@ -314,8 +312,8 @@ fi
 
 %post nagios
 # TODO: do as much as possible to get the host setup and running.
-chkconfig --add monitor-nagios
-chkconfig monitor-nagios on
+#chkconfig --add monitor-nagios
+#chkconfig monitor-nagios on
 chkconfig mysqld on
 
 %post server
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