aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfig/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