Skip to content

Instantly share code, notes, and snippets.

@smagch
Created May 28, 2012 02:52
Show Gist options
  • Save smagch/2816949 to your computer and use it in GitHub Desktop.
Save smagch/2816949 to your computer and use it in GitHub Desktop.
seaport server upstart
#!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