pkgsrc/www/apache/files/apache.sh
jlam 76bdc72fc4 As per discussion in pkg/18854, remove support for apache_start.conf as
the precedence of the contents of this file changes depending on whether
it's started at boot time or started manually, and it's not really
necessary to add the extra complexity since it's valid (and easier) to just
set apache_start in /etc/rc.conf.
2002-11-19 23:08:47 +00:00

49 lines
1,019 B
Bash

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: apache.sh,v 1.24 2002/11/19 23:08:47 jlam Exp $
#
# PROVIDE: apache
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# You will need to set some variables in /etc/rc.conf to start Apache:
#
# apache=YES
# apache_start="start" # set to "startssl" to allow HTTPS connections
# # if ap-ssl is installed; this variable is optional
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="apache"
rcvar=$name
command="@PREFIX@/sbin/httpd"
ctl_command="@PREFIX@/sbin/apachectl"
required_files="@PKG_SYSCONFDIR@/httpd.conf"
extra_commands="reload"
start_cmd="apache_doit start"
stop_cmd="apache_doit stop"
restart_cmd="apache_doit restart"
reload_cmd="apache_doit reload"
apache_doit ()
{
: ${apache_start:=start}
case $1 in
start) action=${apache_start} ;;
reload) action=graceful ;;
*) action=$1 ;;
esac
${ctl_command} ${action}
}
if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]
then
load_rc_config $name
run_rc_command "$1"
else
apache_doit "$1"
fi