pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/39713
The following reply was made to PR pkg/39713; it has been noted by GNATS.
From: Roy Marples <roy%marples.name@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: pkg/39713
Date: Tue, 24 Feb 2009 10:31:03 +0000
--=-zmojANTXTWDuutxcXJYS
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
The problem is that neither httpd nor apachectl bother to block a race
condition when starting or stopping.
rc.subr already has nice code to handle this, so lets just skip
apachectl all together and handle httpd like every other daemon.
The startssl directive no longer works with apache22, so lets remove
that comment also.
The patch below makes everything work nicely and a lot more simple :)
Thanks
Roy
Index: apache.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/www/apache22/files/apache.sh,v
retrieving revision 1.2
diff -u -p -r1.2 apache.sh
--- apache.sh 12 Oct 2008 12:22:25 -0000 1.2
+++ apache.sh 24 Feb 2009 10:18:19 -0000
@@ -5,55 +5,16 @@
# PROVIDE: apache
# REQUIRE: DAEMON
# KEYWORD: shutdown
-#
-# You will need to set some variables in /etc/rc.conf to start Apache:
-#
-# apache=3DYES
-# apache_start=3D"start" # set to "startssl" to allow HTTPS connections;
-# # this variable is optional
=20
-if [ -f /etc/rc.subr ]
-then
- . /etc/rc.subr
-fi
+. /etc/rc.subr
=20
name=3D"apache"
rcvar=3D$name
command=3D"@PREFIX@/sbin/httpd"
-pidfile=3D"/var/run/httpd.pid"
-ctl_command=3D"@PREFIX@/sbin/apachectl"
+command_args=3D"-k start"
required_files=3D"@PKG_SYSCONFDIR@/httpd.conf"
extra_commands=3D"reload"
-start_cmd=3D"apache_doit start"
-stop_cmd=3D"apache_doit stop"
-reload_cmd=3D"apache_doit reload"
+reload_cmd=3D"$command -k graceful"
=20
-apache_doit ()
-{
- : ${apache_start:=3Dstart}
-
- case $1 in
- start) action=3D${apache_start} ;;
- reload) action=3Dgraceful ;;
- *) action=3D$1 ;;
- esac
-
- if [ ! -x ${ctl_command} ]; then
- return
- fi
-
- case ${action} in
- start|startssl) @ECHO@ "Starting ${name}." ;;
- stop) @ECHO@ "Stopping ${name}." ;;
- 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
+load_rc_config $name
+run_rc_command "$1"
--=-zmojANTXTWDuutxcXJYS
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (NetBSD)
iQEcBAABAgAGBQJJo8xiAAoJEFl/l+qa1FVJCuwH/AqDSzI5vcoBV9az7mgn/WoH
HSddE9shep1iR67qj9F6GxcrkXjx4M6yGd3QpZ7womPP8YlIP6BHdGHIzxmyI0wK
6nIQUvpg8CIyJgHZXwO3vJHTPvYUhFjpz8h1Z2OBnCbzQlhgFlO4X1YU9jfpUZxY
zVkyhLlSIfUxrie7TyrKjIBV9NEbSBNjn6sWt71e+c8XikG14lHigjiMz7aLeX+r
zMSYUCYyLdF6galFAra7McdEjvqXYskj8gyPmYYBttm6SPj56RInzX6j0Uwtuo+G
dHtlWke1LJaGoszFZj55eAZyLqe6msSrp+yrYWg1dJa9+et+UDQl6/NOY5MdiUs=
=+XBf
-----END PGP SIGNATURE-----
--=-zmojANTXTWDuutxcXJYS--
Home |
Main Index |
Thread Index |
Old Index