pkgsrc-Changes archive

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

CVS commit: pkgsrc/www/nginx-devel



Module Name:    pkgsrc
Committed By:   khorben
Date:           Mon Nov  8 01:07:37 UTC 2021

Modified Files:
        pkgsrc/www/nginx-devel: Makefile
        pkgsrc/www/nginx-devel/files: nginx.sh

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 pkgsrc/www/nginx-devel/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/www/nginx-devel/files/nginx.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/nginx-devel/Makefile
diff -u pkgsrc/www/nginx-devel/Makefile:1.65 pkgsrc/www/nginx-devel/Makefile:1.66
--- pkgsrc/www/nginx-devel/Makefile:1.65        Wed Sep 15 12:37:33 2021
+++ pkgsrc/www/nginx-devel/Makefile     Mon Nov  8 01:07:37 2021
@@ -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
 

Index: pkgsrc/www/nginx-devel/files/nginx.sh
diff -u pkgsrc/www/nginx-devel/files/nginx.sh:1.1 pkgsrc/www/nginx-devel/files/nginx.sh:1.2
--- pkgsrc/www/nginx-devel/files/nginx.sh:1.1   Fri Feb 22 17:06:54 2013
+++ pkgsrc/www/nginx-devel/files/nginx.sh       Mon Nov  8 01:07:37 2021
@@ -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 @@ command="@PREFIX@/sbin/${name}"
 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