Service does not start: ../sysdeps/posix/getaddrinfo.c and rfc3484_sort weird stuff

Standard

I recently installed apache and I found  a lot of problems trying to start it up.  When I did a

# systemctl start httpd
Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.
[root@malevo httpd]# systemctl status httpd.service
httpd.service – Apache Webserver
Loaded: loaded (/etc/systemd/system/httpd.service; enabled)
Active: failed (Result: start-limit) since mié 2013-10-16 14:27:11 CEST; 3s ago
Process: 897 ExecStart=/usr/sbin/httpd -k start $OPTIONS (code=dumped, signal=ABRT)

oct 16 14:27:10 malevo systemd[1]: httpd.service: control process exited, code=dumped status=6
oct 16 14:27:10 malevo systemd[1]: Failed to start Apache Webserver.
oct 16 14:27:10 malevo systemd[1]: Unit httpd.service entered failed state.
oct 16 14:27:10 malevo systemd-coredump[898]: Process 897 (httpd) dumped core.
oct 16 14:27:10 malevo systemd[1]: httpd.service holdoff time over, scheduling restart.
oct 16 14:27:11 malevo systemd[1]: Stopping Apache Webserver…
oct 16 14:27:11 malevo systemd[1]: Starting Apache Webserver…
oct 16 14:27:11 malevo systemd[1]: httpd.service start request repeated too quickly, refusing to start.
oct 16 14:27:11 malevo systemd[1]: Failed to start Apache Webserver.
oct 16 14:27:11 malevo systemd[1]: Unit httpd.service entered failed state.

So  Itried to start it manually…

[root@malevo httpd]# httpd
httpd         httpd.itk     httpd.worker
[root@malevo httpd]# httpd
httpd: ../sysdeps/posix/getaddrinfo.c:1741: rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a1_native’ failed.
Abortado (`core’ generado)

getaddrinfo? What on earth could mean that?  I did search then and find some hints: first of all, is no apache-related issue, there are a lot of programs can be affected, like java, squid, or whatever…. the common mistake is to think in a corrupted glibc, or duplicate hostname on /etc/hosts… none of them could be the problem, because all other things worked and compiled, so glibc was working as expected, and after take a look inside /etc/hosts, I saw only the entry

127.0.0.1 localhost.localdomain localhost

So I digged even deeper on the Web, and finally found this bug (on glibc) .

The solution is to remove from /etc/nsswitch.conf “myhostname” from this line

hosts: files dns myhostname

Now apache starts as expected. 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s