From ddd55664c532d3f933d4a36e2326d1e75546d7d8 Mon Sep 17 00:00:00 2001 From: jlam Date: Tue, 26 Feb 2002 20:28:41 +0000 Subject: Add back ability to change the value of "apache_start" from /etc/rc.conf that was lost in the previous commit. "${apache_start}" is the subcommand sent to apachectl to control how httpd is started. It's value may be overridden in: @PKG_SYSCONFDIR@/apache_start.conf /etc/rc.conf /etc/rc.conf.d/apache, in order of increasing precedence. Its possible values are "start" and "startssl", and defaults to "start". --- www/apache6/files/apache.sh | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'www/apache6') diff --git a/www/apache6/files/apache.sh b/www/apache6/files/apache.sh index 74d2fa9abec..5777b3a8bf4 100644 --- a/www/apache6/files/apache.sh +++ b/www/apache6/files/apache.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: apache.sh,v 1.12 2002/02/05 06:04:42 jlam Exp $ +# $NetBSD: apache.sh,v 1.13 2002/02/26 20:28:41 jlam Exp $ # # PROVIDE: apache # REQUIRE: DAEMON @@ -18,23 +18,40 @@ name="apache" rcvar=$name command="@PREFIX@/sbin/httpd" ctl_command="@PREFIX@/sbin/apachectl" +required_files="@PKG_SYSCONFDIR@/httpd.conf" +start_cmd="apache_doit start" +stop_cmd="apache_doit stop" +restart_cmd="apache_doit restart" +# "${apache_start}" is the subcommand sent to apachectl to control how +# httpd is started. It's value may be overridden in: +# +# @PKG_SYSCONFDIR@/apache_start.conf +# /etc/rc.conf +# /etc/rc.conf.d/apache, +# +# in order of increasing precedence. Its possible values are "start" +# and "startssl", and defaults to "start". +# apache_start=start if [ -f @PKG_SYSCONFDIR@/apache_start.conf ] then - # This file can reset apache_start to "startssl" . @PKG_SYSCONFDIR@/apache_start.conf fi -required_files="@PKG_SYSCONFDIR@/httpd.conf" -start_cmd="${ctl_command} ${apache_start}" -stop_cmd="${ctl_command} stop" -restart_cmd="${ctl_command} restart" +apache_doit () +{ + case $1 in + start) action=${apache_start} ;; + *) action=$1 ;; + esac + ${ctl_command} ${action} +} if [ -f /etc/rc.subr ] then load_rc_config $name run_rc_command "$1" else - ${start_cmd} + eval ${start_cmd} fi -- cgit v1.2.3