Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 235152 - apache-2.2.9 initscript complains and takes a long time to start
Summary: apache-2.2.9 initscript complains and takes a long time to start
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High minor
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-18 23:20 UTC by michael@smith-li.com
Modified: 2008-08-29 13:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/init.d/apache2 --debug start output (apache2_start,7.58 KB, text/plain)
2008-08-18 23:21 UTC, michael@smith-li.com
Details
apache2_initscript.diff (apache2.diff,1.54 KB, patch)
2008-08-19 03:01 UTC, michael@smith-li.com
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description michael@smith-li.com 2008-08-18 23:20:27 UTC
/etc/init.d/apache2 start takes a really long time to start, and prints a lot to stderr, but eventually works. 

Reproducible: Always

Steps to Reproduce:




Portage 2.2_rc8 (default-bsd/fbsd/6.2/x86, gcc-4.1.2, freebsd-lib-6.2-r4, 6.2-RELEASE i386)
=================================================================
System uname: FreeBSD-6.2-RELEASE-i386-32bit
Timestamp of tree: Mon, 18 Aug 2008 17:30:02 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.4.4-r6, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-devel/autoconf:  2.62-r1
sys-devel/automake:  1.10.1-r1
sys-devel/binutils:  2.17-r2
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.4
virtual/os-headers:  6.2-r4
ACCEPT_KEYWORDS="x86-fbsd ~x86-fbsd"
CBUILD="i686-gentoo-freebsd6.2"
CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
CHOST="i686-gentoo-freebsd6.2"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks parallel-fetch preserve-libs sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS=""
MAKEOPTS="-sj3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="berkdb cli cracklib crypt cups dri gdbm iconv java5 midi ncurses nls oss pam pcre perl postgres ppds python readline reflection session spl ssl tcpd unicode x86-fbsd zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" ELIBC="FreeBSD" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="BSD" VIDEO_CARDS="apm ark chips cirrus cyrix dummy i128 i810 mach64 mga 	neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis 	sisusb tga trident tseng vga via vmware"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 michael@smith-li.com 2008-08-18 23:21:55 UTC
Created attachment 163259 [details]
/etc/init.d/apache2 --debug start output

If I had to guess, I'd say it's an openrc problem, but I'm not too sure.
Comment 2 Javier Villavicencio (RETIRED) gentoo-dev 2008-08-19 00:41:32 UTC
The problem is that the apache init.d script uses (bashism) "let i++" instead of a more portable "i=$(($i+1))", that's why it shows so much stderr at start (FreeBSD's /bin/sh does not understands the i++).

However that might not be the real cause of apache's startup delay, do you have any extra modules or some configuration that might require a freebsd kernel module (kevent/accf_http for example)?
Comment 3 michael@smith-li.com 2008-08-19 03:01:22 UTC
Created attachment 163270 [details, diff]
apache2_initscript.diff

This diff is sh-compliant. I'm not getting the let i++ complaints anymore with the changes here, but I still get...

[Tue Aug 19 02:56:15 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
[Tue Aug 19 02:56:15 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter

I don't know if that's related to missing kernel modules or not...
Comment 4 Javier Villavicencio (RETIRED) gentoo-dev 2008-08-19 12:23:43 UTC
That's the issue indeed, try to load the accf_http[1] kernel module or add it to /boot/loader.conf:

# kldload accf_http
or
# echo 'accf_http_load="YES"' >> /boot/loader.conf
(and reboot)

Apache uses these accept filters [2] to have the kernel handle http requests before apache to increase performance, by default apache is compiled with the filters enabled.

[1] http://www.freebsd.org/cgi/man.cgi?query=accf_http
[2] http://httpd.apache.org/docs/2.2/mod/core.html
Comment 5 michael@smith-li.com 2008-08-20 00:11:49 UTC
(In reply to comment #4)
Yep, that did it. Thanks!
Comment 6 Benedikt Böhm (RETIRED) gentoo-dev 2008-08-29 13:31:15 UTC
message added to apache-2.eclass