From: Michael Tremer Date: Sat, 30 Jan 2010 14:48:00 +0000 (+0100) Subject: Add initscript for webapp. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a5b97a0c2f3517c0d21096f9320982389c61eb1;p=ipfire.org.git Add initscript for webapp. --- diff --git a/www/webapp.init b/www/webapp.init new file mode 100755 index 00000000..8b8e4599 --- /dev/null +++ b/www/webapp.init @@ -0,0 +1,28 @@ +#!/bin/bash + +HOMEDIR=$(dirname $(readlink $0)) +LOGFILE=/srv/logs/www/webapp.error.log + +case "$1" in + start) + cd ${HOMEDIR} && ./webapp.py >>${LOGFILE} 2>&1 & + ;; + + stop) + killall webapp.py + ;; + + restart) + $0 stop + sleep 2 + $0 start + ;; + + check) + if (ps aux | grep -q webapp.py); then + : # Process is running... + else + $0 restart + fi + ;; +esac