summaryrefslogtreecommitdiff
path: root/www/apache
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-02-26 20:28:41 +0000
committerjlam <jlam@pkgsrc.org>2002-02-26 20:28:41 +0000
commitcd8056aeb4c172ced4c6631417bcb9ce89c7a4ad (patch)
tree634ba5e6865f80b61a5196d9119e799ca20243e2 /www/apache
parenta7185c72fc2db2a497c0184fd090b2ce70133305 (diff)
downloadpkgsrc-cd8056aeb4c172ced4c6631417bcb9ce89c7a4ad.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/apache')
-rw-r--r--www/apache/files/apache.sh31
1 files changed, 24 insertions, 7 deletions
diff --git a/www/apache/files/apache.sh b/www/apache/files/apache.sh
index 3b69568e607..605b9c4a56f 100644
--- a/www/apache/files/apache.sh
+++ b/www/apache/files/apache.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: apache.sh,v 1.16 2002/02/05 06:04:42 jlam Exp $
+# $NetBSD: apache.sh,v 1.17 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