Skip to content

Instantly share code, notes, and snippets.

@kacinskas
Last active December 15, 2015 12:39
Show Gist options
  • Save kacinskas/5261441 to your computer and use it in GitHub Desktop.
Save kacinskas/5261441 to your computer and use it in GitHub Desktop.
upstart script skeleton
description "Eldes Alarm Server (Ukmerges g. gate)"
author "tk - http://tadas.kacinskas.eu"
# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
respawn limit 99 5
script
# Not sure why $HOME is needed, but we found that it is:
export HOME="/eldes"
cd /path/to/run/script/in/
exec sh tools/runme.sh > out.txt 2>&1
end script
post-start script
# Optionally put a script here that will notifiy you app has (re)started
DATE=$(date +"%F %T")
cd /path/to/startup/log/
echo "${DATE}: (re)started" >> startups.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment