Mon Nov 8 01:07:37 2021 UTC ()
nginx-devel: let the RC script work unprivileged

This takes advantage of the introduction of the SYSCONFBASE variable.
Tested on NetBSD/amd64.

While there, add support for the "configtest" command in the RC script.

Bumps PKGREVISION.


(khorben)
diff -r1.65 -r1.66 pkgsrc/www/nginx-devel/Makefile
diff -r1.1 -r1.2 pkgsrc/www/nginx-devel/files/nginx.sh

cvs diff -r1.65 -r1.66 pkgsrc/www/nginx-devel/Makefile (expand / switch to unified diff)

--- pkgsrc/www/nginx-devel/Makefile 2021/09/15 12:37:33 1.65
+++ pkgsrc/www/nginx-devel/Makefile 2021/11/08 01:07:37 1.66
@@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
1# $NetBSD: Makefile,v 1.65 2021/09/15 12:37:33 adam Exp $ 1# $NetBSD: Makefile,v 1.66 2021/11/08 01:07:37 khorben Exp $
2 2
3DISTNAME= nginx-1.21.3 3DISTNAME= nginx-1.21.3
 4PKGREVISION= 1
4 5
5MAINTAINER= imil@NetBSD.org 6MAINTAINER= imil@NetBSD.org
6 7
7.include "../../www/nginx/Makefile.common" 8.include "../../www/nginx/Makefile.common"
8.include "../../mk/bsd.pkg.mk" 9.include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/www/nginx-devel/files/nginx.sh (expand / switch to unified diff)

--- pkgsrc/www/nginx-devel/files/nginx.sh 2013/02/22 17:06:54 1.1
+++ pkgsrc/www/nginx-devel/files/nginx.sh 2021/11/08 01:07:37 1.2
@@ -1,19 +1,33 @@ @@ -1,19 +1,33 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: nginx.sh,v 1.1 2013/02/22 17:06:54 imil Exp $ 3# $NetBSD: nginx.sh,v 1.2 2021/11/08 01:07:37 khorben Exp $
4# 4#
5# PROVIDE: nginx 5# PROVIDE: nginx
6# REQUIRE: DAEMON 6# REQUIRE: DAEMON
 7#
 8# You will need to set some variables in @SYSCONFBASE@/rc.conf to start nginx:
 9#
 10# nginx=YES
7 11
8. /etc/rc.subr 12$_rc_subr_loaded . @SYSCONFBASE@/rc.subr
9 13
10name="nginx" 14name="nginx"
11rcvar=${name} 15rcvar=${name}
12command="@PREFIX@/sbin/${name}" 16command="@PREFIX@/sbin/${name}"
13required_files="@PKG_SYSCONFDIR@/${name}.conf" 17required_files="@PKG_SYSCONFDIR@/${name}.conf"
14pidfile="@VARBASE@/run/${name}.pid" 18pidfile="@VARBASE@/run/${name}.pid"
15start_precmd="ulimit -n 2048" 19start_precmd="ulimit -n 2048"
16extra_commands="reload" 20extra_commands="configtest reload"
 21configtest_cmd="nginx_configtest"
 22
 23nginx_configtest()
 24{
 25 if [ ! -f ${required_files} ]; then
 26 warn "${required_files} does not exist."
 27 return 1;
 28 fi
 29 ${command} -t -c ${required_files}
 30}
17 31
18load_rc_config $name 32load_rc_config $name
19run_rc_command "$1" 33run_rc_command "$1"