From: Stephen Soltesz Date: Fri, 18 Jun 2010 23:05:43 +0000 (+0000) Subject: add check to see if mysqld is running in init script X-Git-Tag: monitor-3.1-1~27 X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=commitdiff_plain;h=e01c2cd8fc39ce756ff04dcae3791e8af28013f7 add check to see if mysqld is running in init script --- diff --git a/Monitor.spec b/Monitor.spec index ac97879..8d9ede0 100644 --- a/Monitor.spec +++ b/Monitor.spec @@ -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 diff --git a/nagios/monitor-nagios.init b/nagios/monitor-nagios.init index 1b390fd..ebab5b8 100644 --- a/nagios/monitor-nagios.init +++ b/nagios/monitor-nagios.init @@ -21,6 +21,11 @@ # 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