On Thu, Sep 12, 2013 at 04:28:59PM +0200, Stefan Sperling wrote: > On Wed, Sep 11, 2013 at 10:52:36PM +0200, Antoine Jacoutot wrote: > > On Wed, Sep 11, 2013 at 09:38:54PM +0100, Stuart Henderson wrote: > > > On 2013/09/11 22:26, Antoine Jacoutot wrote: > > > > On Wed, Sep 11, 2013 at 09:50:14PM +0200, Stefan Sperling wrote: > > > > > This fixes two small issues with www/apache-httpd: > > > > > > > > > > - The rc script doesn't work out of the box because it doesn't pass > > > > > the -k option needed for 'start|stop|...' arguments. I hope my > > > > > way of fixing it is appropriate, and welcome other suggestions. > > > > > > > > Hmm... it works fine for me. What error are you running into exactly? > > The rc script prints httpd2(failed). If I manually run the command run > by the script ('/usr/local/sbin/httpd2 start') httpd2 prints its usage.
But this is not the command run by the script. The command run by the script is: $daemon $daemon_flags i.e. '/usr/local/sbin/httpd2' > The script only works without modification if I set > httpd2_daemon_flags="-k" in /etc/rc.conf.local. > > > > It works for me as-is too, though I think -k is more correct (the usage > > > text implies that you have to use it) > > > > Sure but in this case, specific rc_ functions must be written. > > See below. HTTPD wants TERM instead of KILL when stopping, so I've > also added an rc_stop() override. Restart via HUP works fine. > See http://httpd.apache.org/docs/2.2/stopping.html for details. > > > > > > - The readme implies that chroot is not available, while it has > > > > > been available since 2.2.10 and does indeed work as advertised. > > > > > http://httpd.apache.org/docs/2.2/mod/mpm_common.html#chrootdir > > > > > > How about removing MESSAGE? We're trying to get rid of base httpd.. > > > > +1 > > Removing MESSAGE works for me, too. > > Index: Makefile > =================================================================== > RCS file: /cvs/ports/www/apache-httpd/Makefile,v > retrieving revision 1.38 > diff -u -p -r1.38 Makefile > --- Makefile 12 Jul 2013 13:21:25 -0000 1.38 > +++ Makefile 11 Sep 2013 20:18:53 -0000 > @@ -3,6 +3,7 @@ > COMMENT= apache HTTP server > > V= 2.2.25 > +REVISION= 0 > PKGNAME= apache-httpd-${V} > DISTNAME= httpd-${V} > > Index: pkg/MESSAGE > =================================================================== > RCS file: pkg/MESSAGE > diff -N pkg/MESSAGE > --- pkg/MESSAGE 14 Dec 2006 07:14:21 -0000 1.1.1.1 > +++ /dev/null 1 Jan 1970 00:00:00 -0000 > @@ -1,8 +0,0 @@ > -This is the official httpd distributed by the Apache Server Project, > -provided as a port for those who, for various reasons, need to run > -version 2. > - > -OpenBSD provides a custom Apache server, httpd(8), in the base system > -which has been audited for security and may run in a chroot(2) > -environment. Users are STRONGLY encouraged to use the system httpd > -rather than this port. > Index: pkg/httpd2.rc > =================================================================== > RCS file: /cvs/ports/www/apache-httpd/pkg/httpd2.rc,v > retrieving revision 1.1 > diff -u -p -r1.1 httpd2.rc > --- pkg/httpd2.rc 18 Jul 2012 08:45:42 -0000 1.1 > +++ pkg/httpd2.rc 12 Sep 2013 14:22:32 -0000 > @@ -10,4 +10,12 @@ rc_pre() { > rm -f /var/apache2/logs/{ssl_mutex,httpd.lock,accept.lock}.* > } > > +rc_start() { > + ${rcexec} "${daemon} -k start ${daemon_flags} ${_bg}" > +} > + > +rc_stop() { > + ${rcexec} "${daemon} -k stop ${daemon_flags} ${_bg}" > +} > + > rc_cmd $1 > -- Antoine