aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorosa <osa@FreeBSD.org>2008-07-22 13:55:18 +0800
committerosa <osa@FreeBSD.org>2008-07-22 13:55:18 +0800
commit03d0a7e3a96951b3a3e548a79b0bb0e8fe49bc32 (patch)
treedd698ef05d3368c09a0bc9a7910be76b9d7853b3 /www
parent96faaea57e391d85cd9e9f72a94e6a743c6061c8 (diff)
downloadfreebsd-ports-gnome-03d0a7e3a96951b3a3e548a79b0bb0e8fe49bc32.tar.gz
freebsd-ports-gnome-03d0a7e3a96951b3a3e548a79b0bb0e8fe49bc32.tar.zst
freebsd-ports-gnome-03d0a7e3a96951b3a3e548a79b0bb0e8fe49bc32.zip
[1] Don't remove NGINX_TMPDIR directory, if port upgrade running. (*)
[2] Add extra command upgrade for rc, allowing to change binary on-the-fly without loosing any single request. Remove empty string from rc. Bump PORTREVISION. [1,2] Problems reported by: Maxim Dounin aka mdounin at mdounin dot ru PR's: 125762,125766 (*) Undocumented feature from: skv@
Diffstat (limited to 'www')
-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