[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

getservbyname() and glibc 2.1 (was Re: postfix cannot send mail anymore)

On Tue, Mar 16, 1999 at 02:48:28PM +0200, Edvard Majakari wrote:
> >>>>> "Gergely" == Gergely Madarasz <gorgo@caesar.elte.hu> writes:
>  Gergely> Try to restart postfix. If you started it before the glibc
>  Gergely> upgrade, then it is still looking for /lib/libnss_* from
>  Gergely> glibc 2.0, and now it can't find it.
> This doesn't help; I actually rebooted the machine after upgrading
> (took new 2.2.3 kernel in use), but that didn't help either.

i tried recompiling postfix with the new glibc 2.1.

fixed one minor problem - had to s/<db.h>/<db_185.h>/g in a couple
of source (global/mkmap_db.c and util/dict_db.c) files to get it to

(i had to remove man-db and libdb2 and libdb2-dev first. libc6
2.1.1-0pre1.3 Replaces: libdb2 but it doesn't Conflict or Provide it.
man-db depends on libdb2...which means i can only view man pages with
less at the moment on my glibc 2.1 test machine)

I haven't fixed the second problem yet, and it's the one you're seeing.
the "postfix/smtp[20154]: fatal: unknown service: smtp/tcp" is generated
by .../smtp/smtp-connect.c when a getservbyname() call fails.

getservbyname is used in 3 places in postfix:

root@xena /usr/local/src/postfix/postfix-0.0.19990122pl01# find . -name "*.[ch]"  | xargs grep -i getservbyname
./util/find_inet.c:     if ((sp = getservbyname(service, protocol)) == 0)
./smtp/smtp_connect.c:  if ((sp = getservbyname(service, protocol)) == 0)
./local/biff_notify.c:  if ((sp = getservbyname("biff", "udp")) == 0) {

looking at the man page for getservbyname(), it seems that the source is
calling it correctly, but it is returning junk.

this sucks.  badly.    AFAICT, getservbyname hasn't changed for years.  the
man page is dated 1996.

has anyone else had problems with getservbyname() and glibc 2.1?


1. ldd shows that smtp is linked to the right libraries:

root@xena /usr/lib/postfix# ldd smtp
        libdb.so.3 => /lib/libdb.so.3 (0x40018000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x40053000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x40069000)
        libc.so.6 => /lib/libc.so.6 (0x40078000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

root@xena /usr/lib/postfix# ls -lF /lib/libnsl*
-rw-r--r--   1 root     root        97429 Mar 14 18:21 /lib/libnsl-2.1.1.so
lrwxrwxrwx   1 root     root           15 Mar 17 10:01 /lib/libnsl.so.1 -> libnsl-2.1.1.so

2. i have tried this with and without nscd running. doesn't make any

3. i have also tried editing /etc/nsswitch.conf so that:

--- nsswitch.conf.old   Wed Mar 17 11:24:57 1999
+++ nsswitch.conf       Wed Mar 17 11:28:50 1999
@@ -11,9 +11,9 @@
 hosts:          files dns
 networks:       files
-protocols:      db files
-services:       db files
-ethers:         db files
-rpc:            db files
+protocols:      files
+services:       files
+ethers:         files
+rpc:            files
 netgroup:       nis

doesn't make any difference at all. i didn't think it would, but it was
worth trying.

4. i haven't tried rebooting yet. i'll do that next. i'm not expecting
it to make any difference as i've already stopped/started all important


craig sanders

Reply to: