diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile index a3101ff8b2f1..4ba49bd70479 100644 --- a/www/nginx-devel/Makefile +++ b/www/nginx-devel/Makefile @@ -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 diff --git a/www/nginx-devel/files/nginx.sh b/www/nginx-devel/files/nginx.sh index cfaee259f814..d476546512a6 100644 --- a/www/nginx-devel/files/nginx.sh +++ b/www/nginx-devel/files/nginx.sh @@ -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"