Created
April 9, 2015 06:50
-
-
Save henare/4daaa7364bd8eedfd8ac to your computer and use it in GitHub Desktop.
kedumba's Alaveteli init script that's required when deploying using Capistrano as of Alaveteli 0.19: https://github.com/mysociety/alaveteli/blob/release/0.19/doc/CHANGES.md#version-019
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: application-righttoknow | |
# Required-Start: $local_fs $network | |
# Required-Stop: $local_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Provides a restart task for capistrano deployments of Right To Know | |
# Description: Alaveteli expects this script to be available to restart Passenger so this restarts both staging and production | |
### END INIT INFO | |
# This example sysvinit script is based on the helpful example here: | |
# http://richard.wallman.org.uk/2010/02/howto-deploy-a-catalyst-application-using-fastcgi-and-nginx/ | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
NAME=righttoknow.org.au | |
SITE_HOME=/srv/www/test.righttoknow.org.au/current | |
DESC="Alaveteli app server" | |
USER=deploy | |
set -e | |
start_daemon() { | |
# echo -n "Starting $DESC: " | |
# rm -f "$SITE_HOME/public/down.html" | |
# echo "$NAME." | |
echo "Start: is a NOOP for the Right To Know Passenger service" | |
} | |
stop_daemon() { | |
# echo -n "Stopping $DESC: " | |
# cp "$SITE_HOME/public/down.default.html" "$SITE_HOME/public/down.html" | |
# echo "$NAME." | |
echo "Stop: is a NOOP for the Right To Know Passenger service" | |
} | |
restart_daemon() { | |
# echo -n "Restarting $DESC: " | |
# rm -f "$SITE_HOME/public/down.html" | |
# touch "$SITE_HOME/tmp/restart.txt" | |
# echo "$NAME." | |
echo -n "Restarting $DESC: test." | |
touch "/srv/www/test.righttoknow.org.au/current/tmp/restart.txt" | |
echo "$NAME." | |
echo -n "Restarting $DESC: www." | |
touch "/srv/www/www.righttoknow.org.au/current/tmp/restart.txt" | |
echo "$NAME." | |
} | |
case "$1" in | |
start) | |
start_daemon | |
;; | |
stop) | |
stop_daemon | |
;; | |
reload|restart|force-reload) | |
restart_daemon | |
;; | |
*) | |
N=/etc/init.d/$NAME | |
echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment