summaryrefslogtreecommitdiff
path: root/www/apache6
diff options
context:
space:
mode:
authorjlam <jlam>2002-02-26 20:28:41 +0000
committerjlam <jlam>2002-02-26 20:28:41 +0000
commitddd55664c532d3f933d4a36e2326d1e75546d7d8 (patch)
tree634ba5e6865f80b61a5196d9119e799ca20243e2 /www/apache6
parentf437b1f6ce9f93395aa62d83c236212ba2f9f187 (diff)
downloadpkgsrc-ddd55664c532d3f933d4a36e2326d1e75546d7d8.tar.gz
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".
Diffstat (limited to 'www/apache6')
-rw-r--r--www/apache6/files/apache.sh31
1 files changed, 24 insertions, 7 deletions
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