-
-
Save chengdh/7981572 to your computer and use it in GitHub Desktop.
Revisions
-
chengdh revised this gist
Dec 26, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ gunicorn_home=/home/openerp/gunicorn APP_HOME=/home/openerp/openerp/openobject-server APP_ROOT=$APP_HOME/current UNICORN_CONF=$APP_ROOT/newtime-wsgi.py lockfile=${LOCKFILE-$APP_HOME/shared/system/gunicorn.lock} pidfile=$APP_HOME/shared/pids/gunicorn.pid pidfile_old=${pidfile}.oldbin RETVAL=0 -
chengdh revised this gist
Dec 26, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ virtualenv_dir=/home/openerp/openerp/openobject-server/shared/virtualenv start() { echo -n $"Starting $prog: " cd $APP_ROOT . $virtualenv_dir/bin/activate gunicorn --config $UNICORN_CONF --pid $pidfile --daemon -w $gunicorn_workers --access-logfile $accesslog --log-level $loglevel -b $gunicorn_bind $gunicorn_wsgi_app RETVAL=$? echo -n -
chengdh revised this gist
Dec 26, 2013 . 1 changed file with 8 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,27 +22,28 @@ prog=gunicorn gunicorn_home=/home/openerp/gunicorn APP_HOME=/home/openerp/openerp/openobject-server APP_ROOT=$APP_HOME/current UNICORN_CONF=$APP_ROOT/newtime-wsgi.py lockfile=${LOCKFILE-$APP_HOME/shared/system/lock/gunicorn} pidfile=$APP_HOME/shared/pids/gunicorn.pid pidfile_old=${pidfile}.oldbin RETVAL=0 ##gunicorn config### gunicorn_wsgi_app=openerp:service.wsgi_server.application gunicorn_bind=0.0.0.0:8069 gunicorn_workers=4 errorlog=$APP_ROOT/log/gunicorn-error.log accesslog=$APP_ROOT/log/gunicorn-access.log loglevel=debug timeout=50000 virtualenv_dir=/home/openerp/openerp/openobject-server/shared/virtualenv start() { echo -n $"Starting $prog: " cd $APP_ROOT source $virtualenv_dir/bin/activate gunicorn --config $UNICORN_CONF --pid $pidfile --daemon -w $gunicorn_workers --access-logfile $accesslog --log-level $loglevel -b $gunicorn_bind $gunicorn_wsgi_app RETVAL=$? echo -n -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -53,26 +53,26 @@ start() { stop() { echo -n $"Stopping $prog: " kill -QUIT $(cat ${pidfile}) RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} } restart() { echo -n $"Restarting $prog: " kill -USR2 $(cat ${pidfile}) RETVAL=$? echo echo -n $"Stopping old $prog: " kill -QUIT $(cat ${pidfile_old}) RETVAL=$? echo } reload() { echo -n $"Reloading $prog: " kill -HUP $(cat ${pidfile}) RETVAL=$? echo } -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ # chkconfig: - 86 14 # processname: gunicorn # pidfile: # description: Python application server in ubuntu # ### BEGIN INIT INFO # Provides: gunicorn_sr -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,7 @@ start() { stop() { echo -n $"Stopping $prog: " pkill -p ${pidfile} ${prog} -QUIT RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -61,18 +61,18 @@ stop() { restart() { echo -n $"Restarting $prog: " pkill -p ${pidfile} ${prog} -USR2 RETVAL=$? echo echo -n $"Stopping old $prog: " pkill -p ${pidfile_old} ${prog} -QUIT RETVAL=$? echo } reload() { echo -n $"Reloading $prog: " pkill -p ${pidfile} ${prog} -HUP RETVAL=$? echo } -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,8 @@ #. /etc/rc.d/init.d/functions prog=gunicorn gunicorn_home=/home/openerp/gunicorn APP_ROOT=/home/openerp/openerp7/openobject-server UNICORN_CONF=$APP_ROOT/newtime-wsgi.py lockfile=${LOCKFILE-$gunicorn_home/var/lock/gunicorn} @@ -28,7 +30,6 @@ pidfile_old=${pidfile}.oldbin RETVAL=0 ##gunicorn config### gunicorn_wsgi_app=openerp:service.wsgi_server.application gunicorn_bind=0.0.0.0:8069 gunicorn_workers=4 -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,23 +22,22 @@ prog=gunicorn APP_ROOT=/home/openerp/openerp7/openobject-server UNICORN_CONF=$APP_ROOT/newtime-wsgi.py lockfile=${LOCKFILE-$gunicorn_home/var/lock/gunicorn} pidfile=$gunicorn_home/var/run/gunicorn_sr.pid pidfile_old=${pidfile}.oldbin RETVAL=0 ##gunicorn config### gunicorn_home=/home/openerp/gunicorn gunicorn_wsgi_app=openerp:service.wsgi_server.application gunicorn_bind=0.0.0.0:8069 gunicorn_workers=4 errorlog=$gunicorn_home/var/logs/gunicorn-error.log accesslog=$gunicorn_home/var/logs/gunicorn-access.log loglevel=debug timeout=50000 virtualenv_dir=OPENERP start() { echo -n $"Starting $prog: " cd $APP_ROOT -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ prog=gunicorn APP_ROOT=/home/openerp/openerp7/openobject-server UNICORN_CONF=$APP_ROOT/newtime-wsgi.py lockfile=${LOCKFILE-/var/lock/gunicorn} pidfile=/var/run/gunicorn_sr.pid pidfile_old=${pidfile}.oldbin RETVAL=0 -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ start() { echo -n $"Starting $prog: " cd $APP_ROOT . $virtualenv_dir/bin/activate gunicorn --config $UNICORN_CONF --pid $pidfile --daemon -w $gunicorn_workers --access-logfile $accesslog --log-level $loglevel -b $gunicorn_bind $gunicorn_wsgi_app RETVAL=$? echo -n [ $RETVAL = 0 ] && echo -e '[\e[32m OK \e[m]' -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ ### END INIT INFO # Source function library. #. /etc/rc.d/init.d/functions prog=gunicorn APP_ROOT=/home/openerp/openerp7/openobject-server -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -28,14 +28,14 @@ pidfile_old=${pidfile}.oldbin RETVAL=0 ##gunicorn config### gunicorn_wsgi_app=openerp:service.wsgi_server.application gunicorn_bind=0.0.0.0:8069 gunicorn_workers=4 errorlog=/var/logs/gunicorn-error.log accesslog=/var/logs/gunicorn-access.log loglevel=debug timeout=50000 virtualenv_dir=OPENERP -
chengdh revised this gist
Dec 20, 2013 . 1 changed file with 15 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,20 +20,30 @@ . /etc/rc.d/init.d/functions prog=gunicorn APP_ROOT=/home/openerp/openerp7/openobject-server UNICORN_CONF=$APP_ROOT/newtime-wsgi.py lockfile=${LOCKFILE-/var/lock/subsys/gunicorn} pidfile=/var/run/gunicorn_sr.pid pidfile_old=${pidfile}.oldbin RETVAL=0 ##gunicorn config### gunicorn_wsgi_app = "openerp:service.wsgi_server.application" gunicorn_bind = "0.0.0.0:8069" gunicorn_workers = 4 errorlog = /var/logs/gunicorn-error.log accesslog = /var/logs/gunicorn-access.log loglevel = 'debug' timeout = '50000' virtualenv_dir = OPENERP start() { echo -n $"Starting $prog: " cd $APP_ROOT . $virtualenv_dir/bin/activate gunicorn --config $gunicorn_wsgi_app --pid $pidfile --daemon -w $gunicorn_workers --access-logfile $accesslog --log-level $loglevel -b $gunicorn_bind RETVAL=$? echo -n [ $RETVAL = 0 ] && echo -e '[\e[32m OK \e[m]' -
shrkw created this gist
Oct 31, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,104 @@ #!/bin/sh # # gunicorn_sr Startup script for gunicorn for sr # # chkconfig: - 86 14 # processname: gunicorn # pidfile: # description: Python application server # ### BEGIN INIT INFO # Provides: gunicorn_sr # Required-Start: $local_fs $remote_fs $network # Required-Stop: $local_fs $remote_fs $network # Default-Start: 3 # Default-Stop: 0 1 2 4 5 6 # Short-Description: start and stop gunicorn ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions prog=gunicorn APP_ROOT=/PATH/TO/APP UNICORN_CONF=$APP_ROOT/gunicorn.py lockfile=${LOCKFILE-/var/lock/subsys/gunicorn} pidfile=/var/run/gunicorn_sr.pid pidfile_old=${pidfile}.oldbin RETVAL=0 ENV=production start() { echo -n $"Starting $prog: " cd $APP_ROOT . /PATH/TO/YOUR/VIRTUALENV/bin/activate gunicorn --config $UNICORN_CONF --pid $pidfile --daemon --paste ${ENV}.ini RETVAL=$? echo -n [ $RETVAL = 0 ] && echo -e '[\e[32m OK \e[m]' [ $RETVAL = 0 ] && touch ${lockfile} return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc -p ${pidfile} ${prog} -QUIT RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} } restart() { echo -n $"Restarting $prog: " killproc -p ${pidfile} ${prog} -USR2 RETVAL=$? echo echo -n $"Stopping old $prog: " killproc -p ${pidfile_old} ${prog} -QUIT RETVAL=$? echo } reload() { echo -n $"Reloading $prog: " killproc -p ${pidfile} ${prog} -HUP RETVAL=$? echo } rh_status() { status -p ${pidfile} ${prog} } # See how we were called. case "$1" in start) rh_status >/dev/null 2>&1 && exit 0 start ;; stop) stop ;; restart) restart ;; reload) reload ;; condrestart|try-restart) if rh_status >/dev/null 2>&1; then stop start fi ;; status) rh_status RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|reload|condrestart|try-restart|status|help}" RETVAL=2 esac exit $RETVAL