Submitted by Matthew Price in the OGo users list, a simple OGo watchdog process

Note from helge: while useful this should not be necessary in practice? OGo has a *builtin* watchdog which can be enabled using -WOWatchDogEnabled YES.

I have had the ogo backend die on me a couple of times now - not really sure why as it didn't used to do that. I decided to write a watchdog script to bring ogo back up if it dies - just in case.

ogowatchdog.sh
----snip----
STATUS=`/usr/bin/nmap -p 20000 localhost | /bin/grep "20000/tcp open"`
if [ -z "$STATUS" ]
   then
      /etc/init.d/opengroupware start
fi
----snip----

That's it. Modify the paths and naming to suite you. This is from my debian unstable system. You could do the same with:

STATUS=`ps ax | /bin/grep
"WOApps/OpenGroupware.woa/ix86/linux-gnu/gnu-fd-nil/OpenGroupware"`

if you don't [have,want] nmap installed (no line breaks there, of course).

Put this in your crontab with:

* * * * *   /path-to-executable/ogo-watchdog.sh

To have it run every minute. It takes almost no resources for the script to run if ogo is already active.