diff options
-rw-r--r-- | www/nginx-devel/Makefile | 2 | ||||
-rw-r--r-- | www/nginx-devel/files/nginx.sh.in | 22 | ||||
-rw-r--r-- | www/nginx-devel/pkg-plist | 2 |
3 files changed, 22 insertions, 4 deletions
diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile index 33cad4698788..352b86a77dc1 100644 --- a/www/nginx-devel/Makefile +++ b/www/nginx-devel/Makefile @@ -7,7 +7,7 @@ PORTNAME= nginx PORTVERSION= 0.7.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES= http://sysoev.ru/nginx/ MASTER_SITES+= ${MASTER_SITE_LOCAL} diff --git a/www/nginx-devel/files/nginx.sh.in b/www/nginx-devel/files/nginx.sh.in index 069eccbd2a5e..80d1f1f724b6 100644 --- a/www/nginx-devel/files/nginx.sh.in +++ b/www/nginx-devel/files/nginx.sh.in @@ -28,6 +28,8 @@ start_precmd="nginx_precmd" restart_precmd="nginx_checkconfig" reload_precmd="nginx_checkconfig" configtest_cmd="nginx_checkconfig" +upgrade_precmd="nginx_checkconfig" +upgrade_cmd="nginx_upgrade" command="%%PREFIX%%/sbin/nginx" _pidprefix="/var/run/nginx" pidfile="${_pidprefix}.pid" @@ -89,6 +91,23 @@ nginx_checkconfig() eval ${command} ${nginx_flags} -t } +nginx_upgrade() +{ + echo "Upgrading nginx binary:" + + reload_precmd="" + sig_reload="USR2" + run_rc_command ${rc_prefix}reload $rc_extra_args || return 1 + + sleep 1 + + echo "Stopping old binary:" + + sig_reload="QUIT" + pidfile="$pidfile.oldbin" + run_rc_command ${rc_prefix}reload $rc_extra_args || return 1 +} + nginx_precmd() { nginx_checkconfig @@ -99,8 +118,7 @@ nginx_precmd() else return 0 fi - } -extra_commands="reload configtest" +extra_commands="reload configtest upgrade" run_rc_command "$1" diff --git a/www/nginx-devel/pkg-plist b/www/nginx-devel/pkg-plist index 824c6b9b67bc..a7e17fd87740 100644 --- a/www/nginx-devel/pkg-plist +++ b/www/nginx-devel/pkg-plist @@ -21,4 +21,4 @@ sbin/nginx @exec [ -d %%NGINX_TMPDIR%% ] || mkdir -p %%NGINX_TMPDIR%% @exec chown %%WWWOWN%%:%%WWWGRP%% %%NGINX_TMPDIR%% -@unexec rm -fr %%NGINX_TMPDIR%% +@unexec if [ -z ${UPGRADE_PORT} ] ; then rm -fr %%NGINX_TMPDIR%%; fi |