[instructions for running happs at boot time thomashartman1@gmail.com**20080706004445] hunk ./templates/start-happs-on-boot.st 5 -
The following instructions are one way to get your HAppS application to start up automatially when the machine is booted.
+Or what if the HAppS process just dies for +mysterious reasons? hunk ./templates/start-happs-on-boot.st 8 -
cp /etc/init.d/ssh /etc/init.d/happs-app
- -edit that to do the right thing with Main.exe executable.
- -install it into the linux init with
- -sudo update-rc.d happs-app multiuser
- -this is all - - -
These instructions are valid (at least) for debian/ubuntu, loosely following instructions at the debian policy manual.
+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.
hunk ./templates/start-happs-on-boot.st 10 +
+ 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
+