diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-07-25 16:41:03 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-08-07 12:11:14 +0100 |
commit | 6bfcd9f8dc3ba8b45f04d885aa7fbaf38f54cb35 (patch) | |
tree | dce31c7bd9bd78f17df31a5d26a18e632e6e8cf5 | |
parent | a9a9538bd7c7af20571ef15cf22257be35e29bcf (diff) |
Convert sysvinit-example to ugly
-rwxr-xr-x | config/sysvinit-thin.ugly (renamed from config/sysvinit.example) | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/config/sysvinit.example b/config/sysvinit-thin.ugly index 7b2a7f382..1d2bb850a 100755 --- a/config/sysvinit.example +++ b/config/sysvinit-thin.ugly @@ -1,22 +1,22 @@ #! /bin/sh ### BEGIN INIT INFO -# Provides: application-thin-alaveteli +# Provides: application-thin-!!(*= $site *)!! # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Starts the Thin web server for the "Alaveteli" site -# Description: The Thin web server for the "Alaveteli" site +# Short-Description: Starts the Thin web server for the "!!(*= $site *)!!" site +# Description: The Thin web server for the "!!(*= $site *)!!" site ### 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=alaveteli -SITE_HOME="/var/www/$NAME" +NAME=!!(*= $site *)!! +SITE_HOME=!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!! DESC="Alaveteli app server" -USER=alaveteli +USER=!!(*= $user *)!! set -e @@ -24,6 +24,7 @@ set -e su -l -c "cd $SITE_HOME && bundle exec thin --version &> /dev/null || exit 0" $USER start_daemon() { + echo -n "Starting $DESC: " cd "$SITE_HOME"/alaveteli && bundle exec thin \ --environment=production \ --user="$USER" \ @@ -32,14 +33,19 @@ start_daemon() { --daemonize \ --quiet \ start || true + echo "$NAME." } stop_daemon() { + echo -n "Stopping $DESC: " cd "$SITE_HOME" && bundle exec thin --quiet stop || true + echo "$NAME." } restart_daemon() { + echo -n "Restarting $DESC: " cd "$SITE_HOME" && bundle exec thin --onebyone --quiet restart || true + echo "$NAME." } case "$1" in |