Created
May 28, 2012 02:52
-
-
Save smagch/2816949 to your computer and use it in GitHub Desktop.
seaport server upstart
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
#!upstart | |
description "seaport server" | |
author "smagch" | |
start on started mountall | |
stop on shutdown | |
# Automatically Respawn: | |
respawn | |
respawn limit 99 5 | |
script | |
export HOME="/root" | |
su --session-command="/usr/local/bin/seaport 9090 >> /var/log/seaport.log 2>&1" seaport | |
end script | |
pre-start script | |
# Date format same as (new Date()).toISOString() for consistency | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/seaport.log | |
touch /var/log/seaport.log | |
chmod 640 /var/log/seaport.log | |
chown seaport.seaport /var/log/seaport.log | |
end script | |
pre-stop script | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/seaport.log | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment