Created
October 28, 2015 19:56
-
-
Save dayvsonlima/3b47fdf8427e2eab1edf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# puma_server puma_server Server Open Source | |
# | |
# chkconfig: 345 70 30 | |
# description: puma_server Server is a Application Server Platform | |
# processname: puma_server | |
# Source function library. | |
. /etc/init.d/functions | |
RETVAL=0 | |
prog="puma_server" | |
LOCKFILE=/var/lock/subsys/$prog | |
start() { | |
echo -n "Starting puma server... 2" | |
PATH=/usr/local/rvm/gems/ruby-2.2.2/bin:/usr/local/rvm/gems/ruby-2.2.2@global/bin:/usr/local/rvm/rubies/ruby-2.2.2/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin:/usr/local/rvm/bin:/root/bin:/root/.rvm/bin | |
export PATH | |
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting | |
whoami>/tmp/teste | |
source "/usr/local/rvm/scripts/rvm" | |
cd /var/www/pages-service | |
puma --daemon -C config/puma.rb | |
RETVAL=$? | |
[ $RETVAL -eq 0 ] && touch $LOCKFILE | |
echo | |
return $RETVAL | |
} | |
stop() { | |
echo "Stop nao implementado" | |
} | |
status() { | |
echo "status nao implementado"; | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: $prog {start|stop|status|restart}" | |
exit 1 | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment