Start HAppS Automatically At Boot Time
What happens if your HAppS deployment server experiences a power outage?
Or what if the HAppS process just dies for
mysterious reasons?
The way I deal with this both these issues with a public-facing happs application is to have a cron job that runs every minute, that will start the happs application if it isn't running.
thartman@thartman-laptop:~/happs-tutorial>crontab -l
* * * * * /home/thartman/happs-tutorial/happs-tutorial.cron.sh
thartman@thartman-laptop:~/happs-tutorial>cat happs-tutorial.cron.sh
# this is a workaround to a problem that my happs app dies for reasons described at
# http://code.google.com/p/happs/issues/detail?id=40
# generate the executable first by running runServer.sh
# then add this file to your crontab so you have something like
# thartman@thartman-laptop:~>crontab -l
# * * * * * /home/thartman/happs-tutorial/happs-tutorial.cron.sh
if [ -z "`pgrep happs-tutorial`" ];
then cd ~/happs-tutorial
./happs-tutorial >happs-tutorial.cron.out 2>happs-tutorial.cron.err
fi
|