Created
October 7, 2013 14:15
-
-
Save alxschwarz/6868726 to your computer and use it in GitHub Desktop.
LXC Web Panel Upstart script
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 "Upstart script for LXC Web Panel " | |
author "Alexander 'AlexFinn' Ivanov <[email protected]>" | |
start on net-device-up | |
stop on shutdown | |
script | |
WORK_DIR="/srv/lwp" | |
SCRIPT="lwp.py" | |
DAEMON="/usr/bin/python $SCRIPT" | |
USER="root" | |
echo $$ > /var/run/lwp.pid | |
cd $WORK_DIR | |
exec $DAEMON >> /var/log/lwp.log 2>&1 | |
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/lwp.log | |
end script | |
pre-stop script | |
rm /var/run/lwp.pid | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/lwp.log | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment