pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/www/apache22 Provide a new startup script based on a p...
details: https://anonhg.NetBSD.org/pkgsrc/rev/1c6871fe369f
branches: trunk
changeset: 555151:1c6871fe369f
user: tron <tron%pkgsrc.org@localhost>
date: Wed Feb 25 15:39:38 2009 +0000
description:
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:
www/apache22/Makefile | 4 +-
www/apache22/files/apache.sh | 68 ++++++++++++++++++++++----------------------
2 files changed, 36 insertions(+), 36 deletions(-)
diffs (106 lines):
diff -r 01b84cdfab5a -r 1c6871fe369f www/apache22/Makefile
--- a/www/apache22/Makefile Wed Feb 25 15:19:00 2009 +0000
+++ b/www/apache22/Makefile Wed Feb 25 15:39:38 2009 +0000
@@ -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 -r 01b84cdfab5a -r 1c6871fe369f www/apache22/files/apache.sh
--- a/www/apache22/files/apache.sh Wed Feb 25 15:19:00 2009 +0000
+++ b/www/apache22/files/apache.sh Wed Feb 25 15:39:38 2009 +0000
@@ -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"
+ 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"
-apache_doit ()
-{
- : ${apache_start:=start}
-
- 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
Home |
Main Index |
Thread Index |
Old Index