Interesting.  I'm about to do the same, but instead use log-guardian

http://www.tifaware.com/code/log-guardian/log-guardian-1.01

to check the events log for the daemon starting. (I need to know not just that it's running, but that it has restarted so I can initialize my apps). It uses the perl module File::Tail to read new entries from any number of logs, and do pattern matching. Does FMP have a log file you can tail?


On Sunday, February 13, 2005, at 04:55 PM, Wayne Irvine wrote:

Not directly WiTango but related.

I use a shell script triggered once a minute to check whether or not the
WiTango process is alive and if it isn't to resurrect it. It looks like
this:


#!/bin/sh
#checking to see if witangod exists and writing to a variable
/bin/ps ax |grep witango |egrep -v "grep|checkwitango" > /dev/null 2>&1
#echo "$checktango"
if [ $? = "0" ]; then
    echo "Witango is still Running - `date`" >>
/Applications/WitangoServer/5.5/Logs/log.WitangoServer/checkwitango.log
else
    echo "ERROR - Witango is NOT Running - `date`" >>
/Applications/WitangoServer/5.5/Logs/log.WitangoServer/checkwitango.log
    cd /
    cd /Applications/WitangoServer/5.5
    ./witangod -u "wayneirvine"
    if [ $? != "0" ]; then
        echo "I could not run Witango - `date`" >>
/Applications/WitangoServer/5.5/Logs/log.WitangoServer/checkwitango.log
    fi
fi

I'm now trying to write the equivalent for FileMaker Pro as it has developed
a habit of dying periodically. I'll get onto the debugging after I've got a
solution for this issuse. My new script looks like this:


#!/bin/sh
#checking to see if FMP exists and writing to a variable
/bin/ps ax |grep FileMaker\ Pro |egrep -v "grep|checkFMP" > /dev/null 2>&1
#echo "$checkFMP"
if [ $? = "0" ]; then
echo "FMP is still Running - `date`" >> /Applications/FileMaker\ Pro\
5.5\ Folder/logs/checkFMP.log
else
echo "ERROR - FMP is NOT Running - `date`" >> /Applications/FileMaker\
Pro\ 5.5\ Folder/logs/checkFMP.log
cd /
cd /FileMaker\ Pro 5.5 Folder/
./FileMaker\ Pro.app -u "wayneirvine"
if [ $? != "0" ]; then
echo "I could not run FMP - `date`" >> /Applications/FileMaker\
Pro\ 5.5\ Folder/logs/checkFMP.log
fi
fi


Problems: It doesn't seem top recognise when FileMaker has died. The grep
still gives a false positive.


Also, I'm not sure whether I should be looking for FileMaker\ Pro or
FileMaker\ Pro.app (inside the FileMaker\ Pro package) and which I should be
launching in case of an error.


Also, I need to launch the app and open a file and I have no idea how to do
this in a shell script.


Any help you can give would be greatly appreciate.

Wayne Irvine
                  Byte Services Pty Ltd
               http://www.byteserve.com.au/
                  [EMAIL PROTECTED]
   Ph 02 9960 6099   Mob 0409 960 609   Fax 02 9960 6088

_______________________________________________________________________ _
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf



________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to