View previous topic :: View next topic |
Author |
Message |
voor
Joined: 27 Apr 2007 Posts: 6
|
Posted: Fri Apr 27, 2007 5:16 pm Post subject: keeping RMA running |
|
|
I would like to make sure that RMA is always running on my servers and restart it if it died or has been killed for some reason. For other programs that generate a <program>.pid file like syslogd, I can do this in crontab by reading the PID from the file and then checking the process table. Is there any option to make RMA save its PID to a file in a similar manner? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Apr 27, 2007 5:24 pm Post subject: |
|
|
Probably we can implement such option in next version
Regards
Alex |
|
Back to top |
|
|
voor
Joined: 27 Apr 2007 Posts: 6
|
Posted: Fri Apr 27, 2007 5:51 pm Post subject: |
|
|
That would be great, looking forward to it! |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
|
Back to top |
|
|
voor
Joined: 27 Apr 2007 Posts: 6
|
Posted: Wed May 16, 2007 8:00 pm Post subject: |
|
|
Works perfectly, thanks! |
|
Back to top |
|
|
voor
Joined: 27 Apr 2007 Posts: 6
|
Posted: Mon May 21, 2007 7:03 pm Post subject: |
|
|
If anyone is interested, this 'rmachk' Bourne shell script is what I use to check whether RMA is running. If it's not running, then the script will start it and redirect the startup output to /dev/null. Much of the code was shamelessly borrowed from psybncchk. The RMA client must be version 1.25 or higher and the PidFile line in rma.ini must be uncommented.
Code: | #!/bin/sh
# assume the 'rma' executable is at /rma/rma and the PID file is at /var/run/rma.pid
RMAPATH=/rma
RMAPIDPATH=/var/run
# if 'kill -CHLD' is not recognized by the OS (like Solaris), try 'kill -CLD' instead
if test -r $RMAPIDPATH/rma.pid; then
RMAPID=`cat $RMAPIDPATH/rma.pid`
if `kill -CHLD $RMAPID >/dev/null 2>&1`
then
exit 0
fi
fi
cd $RMAPATH
./rma rma.ini > /dev/null 2>&1
|
And this crontab entry tells cron to run rmachk every minute:
Code: | * * * * * /rma/rmachk > /dev/null 2>&1 |
|
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue May 22, 2007 8:45 am Post subject: |
|
|
Thank you for contribution
Regards
Alex |
|
Back to top |
|
|
|