Veritas cluster server is often used in corporate environments to provide clustering and high availability. Veritas is a complex, closed source product that provides integration for lots of enterprise software such as SAP or Oracle, but it is very simple to use it to cluster open source software as well.
In order for Veritas to manage a piece of open source software you need to provide three scripts; a script to start the service, a script to stop the service and a script that monitors the status of the software. The start and stop scripts don’t need any special knowledge they just need to start and stop the service, if the application has an init.d script that should be sufficient for the start and stop script.
So if we have a mythical open source application called gherkin then the Veritas agent can be configured to use this as a start script:
and this for the stop script:
Unfortunately Veritas doesn’t use standard UNIX return codes for monitoring it has its own numeric values, namely 110 for an active service and 100 for an inactive service, so you will need to provide a script to map the services status to these numbers.
For example if our mythical open source application returns status from its init.d script then we will need a script like this:
#!/bin/bash if /etc/init.d/gherkin status &> /dev/null; then Â Â Â Â exit 110 else Â Â Â Â exit 100 fi
This maps a standard UNIX successful return code to the Veritas success code, 110, and everything else to the Veritas failure code, 100.