[ic] Auto Restart when IC server is down

Ed LaFrance interchange-users@lists.akopia.com
Mon Jun 4 12:13:00 2001


At 12:45 PM 06/03/2001 -0400, you wrote:
>I'd like to modify the code (ic 4.7.6) in the cgi link file so that if the
>ic server is down it will restart automatically rather than just presenting
>a message. It goes down at least once a week when my provider does backup or
>something. I tried opening it in my text editor but was just scrambled. Any
>way to easily modify this without a C compiler on my local machine (Mac OS
>8.6) Can it be done through telnet with unix commands? If so please advise,
>thanks. (I'm OK on basic stuff but not a unix wizard)
>

You can write a little shell script like this,

#!/bin/sh
var=`ps ux | grep interchange | grep -v -c grep`
if [ $var -eq 0 ]; then
         /command/to/start/interchange -options
fi

...and then call it every 5 minutes with a crontab:

1,5,10,15,20,25,30,35,40,45,50,55 * * * * /dir/./myscript >>cron.log

-Ed L.


===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================