pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/nginx-devel nginx-devel: let the RC script work un...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c94b66a0f48b
branches:  trunk
changeset: 769104:c94b66a0f48b
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Mon Nov 08 01:07:37 2021 +0000

description:
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.

diffstat:

 www/nginx-devel/Makefile       |   3 ++-
 www/nginx-devel/files/nginx.sh |  20 +++++++++++++++++---
 2 files changed, 19 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 5d8ed6f126cc -r c94b66a0f48b www/nginx-devel/Makefile
--- a/www/nginx-devel/Makefile  Mon Nov 08 01:02:01 2021 +0000
+++ b/www/nginx-devel/Makefile  Mon Nov 08 01:07:37 2021 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.65 2021/09/15 12:37:33 adam Exp $
+# $NetBSD: Makefile,v 1.66 2021/11/08 01:07:37 khorben Exp $
 
 DISTNAME=      nginx-1.21.3
+PKGREVISION=   1
 
 MAINTAINER=    imil%NetBSD.org@localhost
 
diff -r 5d8ed6f126cc -r c94b66a0f48b www/nginx-devel/files/nginx.sh
--- a/www/nginx-devel/files/nginx.sh    Mon Nov 08 01:02:01 2021 +0000
+++ b/www/nginx-devel/files/nginx.sh    Mon Nov 08 01:07:37 2021 +0000
@@ -1,11 +1,15 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: nginx.sh,v 1.1 2013/02/22 17:06:54 imil Exp $
+# $NetBSD: nginx.sh,v 1.2 2021/11/08 01:07:37 khorben Exp $
 #
 # PROVIDE: nginx
 # REQUIRE: DAEMON
+#
+# You will need to set some variables in @SYSCONFBASE@/rc.conf to start nginx:
+#
+# nginx=YES
 
-. /etc/rc.subr
+$_rc_subr_loaded . @SYSCONFBASE@/rc.subr
 
 name="nginx"
 rcvar=${name}
@@ -13,7 +17,17 @@
 required_files="@PKG_SYSCONFDIR@/${name}.conf"
 pidfile="@VARBASE@/run/${name}.pid"
 start_precmd="ulimit -n 2048"
-extra_commands="reload"
+extra_commands="configtest reload"
+configtest_cmd="nginx_configtest"
+
+nginx_configtest()
+{
+       if [ ! -f ${required_files} ]; then
+               warn "${required_files} does not exist."
+               return 1;
+       fi
+       ${command} -t -c ${required_files}
+}
 
 load_rc_config $name
 run_rc_command "$1"



Home | Main Index | Thread Index | Old Index