diff options
author | tron <tron> | 2009-02-25 15:39:38 +0000 |
---|---|---|
committer | tron <tron> | 2009-02-25 15:39:38 +0000 |
commit | c51fbbe20d9fc395d93f49c70ebd7a36db45ddbb (patch) | |
tree | 72bcae677503e7ef8ec9a646f0150c11f1ddd4b9 /www | |
parent | 4b987938035bead7c46f7f3af1290ec01d74d389 (diff) | |
download | pkgsrc-c51fbbe20d9fc395d93f49c70ebd7a36db45ddbb.tar.gz |
Provide a new startup script based on a patch supplied by Roy Marples:
1.) On platforms which provide "/etc/rc.subr" we use its process id check
to figure out when Apache actually has been stopped.
2.) On other platforms we just implement "restart" by "stop and a 10 second
delay followed by "start". If you want a better fix for please submit
a bug report to the Apache project.
This finally fixes PR pkg/39713.
Diffstat (limited to 'www')
-rw-r--r-- | www/apache22/Makefile | 4 | ||||
-rw-r--r-- | www/apache22/files/apache.sh | 68 |
2 files changed, 36 insertions, 36 deletions
diff --git a/www/apache22/Makefile b/www/apache22/Makefile index 4ce2eb8ae77..b59d063313c 100644 --- a/www/apache22/Makefile +++ b/www/apache22/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.38 2009/02/05 16:39:18 sborrill Exp $ +# $NetBSD: Makefile,v 1.39 2009/02/25 15:39:38 tron Exp $ DISTNAME= httpd-2.2.11 -PKGREVISION= 1 +PKGREVISION= 2 PKGNAME= ${DISTNAME:S/httpd/apache/} CATEGORIES= www MASTER_SITES= ${MASTER_SITE_APACHE:=httpd/} \ diff --git a/www/apache22/files/apache.sh b/www/apache22/files/apache.sh index 096338198bb..b59c03e44bf 100644 --- a/www/apache22/files/apache.sh +++ b/www/apache22/files/apache.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: apache.sh,v 1.2 2008/10/12 12:22:25 tron Exp $ +# $NetBSD: apache.sh,v 1.3 2009/02/25 15:39:38 tron Exp $ # # PROVIDE: apache # REQUIRE: DAEMON @@ -12,48 +12,48 @@ # apache_start="start" # set to "startssl" to allow HTTPS connections; # # this variable is optional +name="apache" + if [ -f /etc/rc.subr ] then . /etc/rc.subr -fi - -name="apache" -rcvar=$name -command="@PREFIX@/sbin/httpd" -pidfile="/var/run/httpd.pid" -ctl_command="@PREFIX@/sbin/apachectl" -required_files="@PKG_SYSCONFDIR@/httpd.conf" -extra_commands="reload" -start_cmd="apache_doit start" -stop_cmd="apache_doit stop" -reload_cmd="apache_doit reload" -apache_doit () -{ - : ${apache_start:=start} + rcvar=$name + command="@PREFIX@/sbin/httpd" + command_args="-k start" + pidfile="@VARBASE@/run/httpd.pid" + required_files="@PKG_SYSCONFDIR@/httpd.conf" + extra_commands="reload" + reload_cmd="$command -k graceful" - case $1 in - start) action=${apache_start} ;; - reload) action=graceful ;; - *) action=$1 ;; - esac + load_rc_config $name + run_rc_command "$1" +else + ctl_command="@PREFIX@/sbin/apachectl" if [ ! -x ${ctl_command} ]; then return fi - case ${action} in - start|startssl) @ECHO@ "Starting ${name}." ;; - stop) @ECHO@ "Stopping ${name}." ;; + case "$1" in + start) + @ECHO@ "Starting ${name}." + ${ctl_command} start + ;; + stop) + @ECHO@ "Stopping ${name}." + ${ctl_command} stop + ;; + reload) + ${ctl_command} graceful + ;; + restart) + "$0" stop + sleep 10 + "$0" start + ;; + *) + ${ctl_command} "$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 |