Here is a script that you can use to start your application on Linux. What this script will do is read in all the arguments from the command line and store them in a special shell variable. If the application segmentation faults, the script will automatically start the application using all the command line arguments. Also this will write that the application has died to any syslog on the system.
Here is how it should be called.
/usr/bin/appstarter.ksh /opt/bin/program_binary arg1 arg2 arg3 arg4 arg5 arg6 argN
And here is the actual code written in KSH.
while true; do
while [[ `/bin/ps -e -o command | /bin/egrep "^$*$" | /bin/grep -v grep|/usr/bin/wc -l` -eq 0 ]] ; do
echo "Starting $* ...";
/bin/logger -p local1.notice "Application died on `/usr/bin/whoami`@`/bin/hostname`: $*";
echo "Application died: $*";