mysql start script

From: Rezk Mekhael (rezk@clunet.edu)
Date: Wed Oct 15 2003 - 12:57:17 EDT


Hi Managers,

I have 2 questions:

I have Ds20 with OS 5.1v, I am running mysql server, and some time it
stop for that I create csh script to watch it, and if goes down restart
it.

1) The Script:
#!/bin/csh

# checks the mysql server daemon and restart if needed
# customized for Mysql on lupine Rezk Mekhael 10/2003
umask 077
set tmp=/tmp/chkmysql.$$
set manager=rezk@clunet.edu
ps ax > $tmp
if ( `grep -c "mysql" $tmp` != "0" ) then
        echo "listener is running" > /dev/null
else
        /sbin/rc3.d/s100mysql
        echo "Mysql Server is down, starting it up" > /tmp/message.$$
        /usr/bin/mail $manager < /tmp/message.$$
        rm -r /tmp/message.$$
endif

rm -f $tmp
=======================================

2) This file "/sbin/rc3.d/s100mysql" contains:

cd /usr/local/mysql;
bin/safe_mysqld --user=mysql

My questions: 1) I can run this file S100mysql by hand but the script
can not run it, why?
                        2) Does any one have a startup script for mysql
in /sbin/rc3.d?
 

-rwxrwxr-x 1 root bin 53 Oct 15 00:17
/sbin/rc3.d/s100mysql
lrwxrwxrwx 1 root system 37 Sep 12 12:06 /usr/local/mysql
-> mysql-max-4.0.13-dec-osf5.1-alphaev67
lrwxrwxrwx 1 1265 system 11 Sep 12 12:06
/usr/local/mysql/bin/safe_mysqld -> mysqld_safe

--
Sincerely,
Rezk Mekhael
-- 
*** Incoming / Outgoing Mail scanned for known Viruses by CLUnet ***


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:38 EDT