aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org>2012-06-13 04:46:14 +0000
committerSergey A. Osokin <osa@FreeBSD.org>2012-06-13 04:46:14 +0000
commit955fb96849384905563eeaa238873abfc709f3ff (patch)
tree4104da0e47bb6417c5529d5cde93e67a76e8c36d
parent8163ab01457dc2684c947a023e07331178c55e14 (diff)
Check existence temporary directory %%NGINX_TMPDIR%% before
test configuration. (1) Use %%NGINX_RUNDIR%%, %%WWWOWN%% and %%WWWGRP%% variables defined in Makefile instead of hardcoded or new values. Bump PORTREVISION. Idea from PR: 168836 (1)
Notes
Notes: svn path=/head/; revision=299166
-rw-r--r--www/nginx-devel/Makefile6
-rw-r--r--www/nginx-devel/files/nginx.sh.in16
-rw-r--r--www/nginx/Makefile6
-rw-r--r--www/nginx/files/nginx.sh.in16
4 files changed, 38 insertions, 6 deletions
diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile
index 12b11a7b2c65..4cf46f680a99 100644
--- a/www/nginx-devel/Makefile
+++ b/www/nginx-devel/Makefile
@@ -7,6 +7,7 @@
PORTNAME= nginx
PORTVERSION= 1.3.1
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://nginx.org/download/
MASTER_SITES+= ${MASTER_SITE_LOCAL}
@@ -207,7 +208,10 @@ NGINX_ERRORLOG?= ${NGINX_LOGDIR}/nginx-error.log
CONFLICTS?= nginx-1.*
USE_RC_SUBR= nginx.sh
-SUB_LIST+= WWWOWN=${WWWOWN}
+SUB_LIST+= WWWOWN=${WWWOWN} \
+ WWWGRP=${WWWGRP} \
+ NGINX_RUNDIR=${NGINX_RUNDIR} \
+ NGINX_TMPDIR=${NGINX_TMPDIR}
.if !defined(NO_INSTALL_MANPAGES)
MAN8= nginx.8
.endif
diff --git a/www/nginx-devel/files/nginx.sh.in b/www/nginx-devel/files/nginx.sh.in
index 03c6600014cb..1fdec800414a 100644
--- a/www/nginx-devel/files/nginx.sh.in
+++ b/www/nginx-devel/files/nginx.sh.in
@@ -32,8 +32,9 @@ gracefulstop_cmd="nginx_gracefulstop"
upgrade_precmd="nginx_checkconfig"
upgrade_cmd="nginx_upgrade"
command="%%PREFIX%%/sbin/nginx"
-_pidprefix="/var/run/nginx"
-pidfile="${_pidprefix}.pid"
+_pidprefix="%%NGINX_RUNDIR%%"
+pidfile="${_pidprefix}/${name}.pid"
+_tmpprefix="%%NGINX_TMPDIR%%"
required_files=%%PREFIX%%/etc/nginx/nginx.conf
extra_commands="reload configtest upgrade gracefulstop"
@@ -77,8 +78,19 @@ else
fi
fi
+# tmpfs(5)
+nginx_checktmpdir()
+{
+ if [ ! -d ${_tmpprefix} ] ; then
+ mkdir -p ${_tmpprefix}
+ chown %%WWWOWN%%:%%WWWGRP%% ${_tmpprefix}
+ fi
+}
+
nginx_checkconfig()
{
+ nginx_checktmpdir
+
echo "Performing sanity check on nginx configuration:"
eval ${command} ${nginx_flags} -t
}
diff --git a/www/nginx/Makefile b/www/nginx/Makefile
index ac9e721ba2bd..a47c0951283d 100644
--- a/www/nginx/Makefile
+++ b/www/nginx/Makefile
@@ -7,6 +7,7 @@
PORTNAME= nginx
PORTVERSION= 1.2.1
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= http://nginx.org/download/
@@ -207,7 +208,10 @@ NGINX_ERRORLOG?= ${NGINX_LOGDIR}/nginx-error.log
CONFLICTS?= nginx-devel-1.*
USE_RC_SUBR= nginx.sh
-SUB_LIST+= WWWOWN=${WWWOWN}
+SUB_LIST+= WWWOWN=${WWWOWN} \
+ WWWGRP=${WWWGRP} \
+ NGINX_RUNDIR=${NGINX_RUNDIR} \
+ NGINX_TMPDIR=${NGINX_TMPDIR}
.if !defined(NO_INSTALL_MANPAGES)
MAN8= nginx.8
.endif
diff --git a/www/nginx/files/nginx.sh.in b/www/nginx/files/nginx.sh.in
index 03c6600014cb..1fdec800414a 100644
--- a/www/nginx/files/nginx.sh.in
+++ b/www/nginx/files/nginx.sh.in
@@ -32,8 +32,9 @@ gracefulstop_cmd="nginx_gracefulstop"
upgrade_precmd="nginx_checkconfig"
upgrade_cmd="nginx_upgrade"
command="%%PREFIX%%/sbin/nginx"
-_pidprefix="/var/run/nginx"
-pidfile="${_pidprefix}.pid"
+_pidprefix="%%NGINX_RUNDIR%%"
+pidfile="${_pidprefix}/${name}.pid"
+_tmpprefix="%%NGINX_TMPDIR%%"
required_files=%%PREFIX%%/etc/nginx/nginx.conf
extra_commands="reload configtest upgrade gracefulstop"
@@ -77,8 +78,19 @@ else
fi
fi
+# tmpfs(5)
+nginx_checktmpdir()
+{
+ if [ ! -d ${_tmpprefix} ] ; then
+ mkdir -p ${_tmpprefix}
+ chown %%WWWOWN%%:%%WWWGRP%% ${_tmpprefix}
+ fi
+}
+
nginx_checkconfig()
{
+ nginx_checktmpdir
+
echo "Performing sanity check on nginx configuration:"
eval ${command} ${nginx_flags} -t
}