untangle control script from thin

This commit is contained in:
Gwenhael Le Moine 2015-01-11 09:26:37 +01:00
parent 54016a8ee9
commit 7fdd463391
2 changed files with 18 additions and 18 deletions

View file

@ -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

View file

@ -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"