aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-07-25 13:19:31 +0100
committerGareth Rees <gareth@mysociety.org>2014-08-07 12:11:14 +0100
commitfb5e0db815daaf75e4b5f581ea8b03403df122ca (patch)
tree45d92424aa08d3162d97532764315ed1a054d967
parent41313ad0cddb236d0f1c28b4f57824aa8217fcb3 (diff)
Update how thin starts and stops
Use long form options for clarity Use thin’s built in start and stop mechanisms Use thin’s built in process owner options Bind to localhost only
-rwxr-xr-xconfig/sysvinit.example11
1 files changed, 9 insertions, 2 deletions
diff --git a/config/sysvinit.example b/config/sysvinit.example
index 2514fe003..f44fae986 100755
--- a/config/sysvinit.example
+++ b/config/sysvinit.example
@@ -24,11 +24,18 @@ test -f $DAEMON || exit 0
set -e
start_daemon() {
- su -l -c "cd $SITE_HOME/alaveteli && bundle exec thin -d -e production start" $USER
+ cd "$SITE_HOME"/alaveteli && bundle exec thin \
+ --environment=production \
+ --user="$USER" \
+ --group="$USER" \
+ --address=127.0.0.1 \
+ --daemonize \
+ start
}
stop_daemon() {
- pkill -f thin -u $USER || true
+ cd "$SITE_HOME"/alaveteli && bundle exec thin stop
+}
}
case "$1" in