untangle control script from thin
This commit is contained in:
parent
54016a8ee9
commit
7fdd463391
2 changed files with 18 additions and 18 deletions
|
@ -1,13 +0,0 @@
|
||||||
# user: apache
|
|
||||||
# group: apache
|
|
||||||
pid: thin.pid
|
|
||||||
log: thin.log
|
|
||||||
timeout: 30
|
|
||||||
max_conns: 1024
|
|
||||||
port: 9292
|
|
||||||
max_persistent_conns: 512
|
|
||||||
environment: production
|
|
||||||
adapter: rack
|
|
||||||
servers: 1
|
|
||||||
daemonize: true
|
|
||||||
tag: ledgerrb
|
|
23
rc.ledgerrb
23
rc.ledgerrb
|
@ -1,19 +1,32 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
THIN='bundle exec thin'
|
SERVER='bundle exec puma'
|
||||||
THINYML=$(pwd)/config/thin.yml
|
SERVER_OPTIONS=' --daemon --pidfile $PIDFILE'
|
||||||
|
PIDFILE=./puma.pid
|
||||||
|
|
||||||
|
function start() {
|
||||||
|
$SERVER $SERVER_OPTIONS
|
||||||
|
}
|
||||||
|
|
||||||
|
function stop() {
|
||||||
|
[ -e $PIDFILE ] && kill $(cat $PIDFILE)
|
||||||
|
}
|
||||||
|
|
||||||
|
function restart() {
|
||||||
|
stop && sleep 3 && start
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
"start")
|
"start")
|
||||||
$THIN -C $THINYML start
|
start
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"stop")
|
"stop")
|
||||||
$THIN -C $THINYML stop
|
stop
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"restart")
|
"restart")
|
||||||
$THIN -C $THINYML restart
|
restart
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage; start|stop|restart"
|
echo "Usage; start|stop|restart"
|
||||||
|
|
Loading…
Add table
Reference in a new issue