mirror of
https://github.com/gwenhael-le-moine/ledgerrb.git
synced 2025-01-13 08:01:20 +01:00
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
|
||||
|
||||
THIN='bundle exec thin'
|
||||
THINYML=$(pwd)/config/thin.yml
|
||||
SERVER='bundle exec puma'
|
||||
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
|
||||
"start")
|
||||
$THIN -C $THINYML start
|
||||
start
|
||||
;;
|
||||
|
||||
"stop")
|
||||
$THIN -C $THINYML stop
|
||||
stop
|
||||
;;
|
||||
|
||||
"restart")
|
||||
$THIN -C $THINYML restart
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage; start|stop|restart"
|
||||
|
|
Loading…
Reference in a new issue