Last active
December 15, 2015 12:39
-
-
Save kacinskas/5261468 to your computer and use it in GitHub Desktop.
Upstart script skeleton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# put it in /etc/init/app-name.conf | |
# | |
# Usage run: | |
# start app-name | |
# stop app-name | |
description "Eldes Alarm Server (Ukmerges g. gate)" | |
author "eldes - http://eldes.lt" | |
# 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/startups/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