aboutsummaryrefslogtreecommitdiff
path: root/www/nginx-devel
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org>2008-07-22 05:55:18 +0000
committerSergey A. Osokin <osa@FreeBSD.org>2008-07-22 05:55:18 +0000
commitbffdc23e01bd265d5665c10cf50dffea9953ad12 (patch)
treecf72164c96bb6fa32a2d7bc4705f9789d0e9a8d2 /www/nginx-devel
parent2e5661c052fe765ea5f7f9dd2e13f674d65ed857 (diff)
downloadports-bffdc23e01bd265d5665c10cf50dffea9953ad12.tar.gz
ports-bffdc23e01bd265d5665c10cf50dffea9953ad12.zip
Notes
Diffstat (limited to 'www/nginx-devel')
-rw-r--r--www/nginx-devel/Makefile2
-rw-r--r--www/nginx-devel/files/nginx.sh.in22
-rw-r--r--www/nginx-devel/pkg-plist2
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