This problem regard QMAIL 1.03-r15, the latest stable available. On my AMD64 system, if I do not specify TCPSERVER_PORT=25 in /var/qmail/control/conf-smtpd , qmail-smtpd won't start and would quickly fill my log with messages like this: @400000004191d3d32324e12c tcpserver: fatal: unable to figure out port number for smtp Since this seems to happen to some people, shouldn't TCPSERVER_PORT=25 better be added to the configuration file by default? Reproducible: Always Steps to Reproduce: 1. emerge qmail 2. ln -s /var/qmail/supervise/qmail-smtpd/ /service/ Actual Results: qmail-smtpd won't start and the log file /var/log/qmail/qmail-smtpd/current quickly began filling with: @400000004191d3d32324e12c tcpserver: fatal: unable to figure out port number for smtp Expected Results: qmail-smtpd should have started with no problem Portage 2.0.51-r3 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.9-nitro2 x86_64) ================================================================= System uname: 2.6.9-nitro2 x86_64 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.15.90.0.1.1-r3 Headers: sys-kernel/linux26-headers-2.6.8.1-r1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CFLAGS="-march=athlon64 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon64 -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox" GENTOO_MIRRORS="ftp://gentoo.netnitco.net/pub/mirrors/gentoo/source/ http://gentoo.math.bme.hu http://gentoo.tiscali.nl/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X acpi alsa apache2 arts berkdb bitmap-fonts cdr crypt cups esd f77 fam foomaticdb fortran gdbm gif gnome gpm gstreamer gtk imagemagick imlib ipv6 java jp2 jpeg libwww lzw lzw-tiff maildir mikmod motif mozilla multilib mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python readline samba slang ssl tcpd tiff truetype usb userlocales xml2 xmms xpm xrandr xv zlib"
why doesn't your /etc/services contain the smtp line? a lot of other stuff needs it beyond qmail.
> why doesn't your /etc/services contain the smtp line? Why do you say this? My /etc/services (which is the one provided by Gentoo) *contains* the smtp line: smtp 25/tcp mail
The error 'tcpserver: fatal: unable to figure out port number for smtp' means that tcpserver cannot resolve what port number the name 'smtp' is associated with. Two possible reasons for this: 1. /etc/services doesn't have it 2. nsswitch/nscd broke lookups #2 is far more serious than #1. You can check for either of these conditions via running: "getent services smtp" which should print something like: "smtp 25/tcp mail"
> You can check for either of these conditions via running: > "getent services smtp" > which should print something like: > "smtp 25/tcp mail" Actually, it does "getent services smtp" works just fine and prints: smtp 25/tcp mail So, it seems my system gets the port number fine, but qmail-qsmtpd is the only one who doesn't (other MTAs work just fine). Michele.
it's not qmail-smtpd (I'm assuming you just typoed it in your last comment) that resolves the port number, it's tcpserver. Could you possibly debug thru tcpserver and find why it isn't resolving the port name? For a minimal tcpserver setup for testing, stop your mail system, and run: tcpserver 0.0.0.0 smtp /usr/bin/printenv if that works on it's own, combine it with the various tcpserver parameters that you use for qmail-smtpd.
Hi tried the command you sent me and it works, and it also works up to the following (status: 0/40), which is the command line I find in "ps ax" regarding tcpserver for qmail-smtpd: /usr/bin/tcpserver -p -v -R -x /etc/tcprules.d/tcp.qmail-smtp.cdb -c 40 -u 201 -g 200 0.0.0.0 25 /var/qmail/bin/qmail-smtpd And it works also if I do: /usr/bin/tcpserver -p -v -R -x /etc/tcprules.d/tcp.qmail-smtp.cdb -c 40 -u 201 -g 200 0.0.0.0 smtp /var/qmail/bin/qmail-smtpd (with "smtp" in place of "25" as port number). I think that supervise launches tcpserver as follows, and this causes the error: /usr/bin/tcpserver -p -v -R -x /etc/tcprules.d/tcp.qmail-smtp.cdb -c 40 -u 201 -g 200 0.0.0.0 /var/qmail/bin/qmail-smtpd (no port/service is specified after the IP address). I took a look at /var/qmail/supervise/qmail-smtpd/run and it's got the following: SERVICE=smtp source /var/qmail/bin/qmail-config-system && \ exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \ ${QMAIL_TCPSERVER_PRE} \ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x ${TCPSERVER_RULESCDB} \ -c ${MAXCONN} -u ${QMAILDUID} -g ${NOFILESGID} \ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \ ${QMAIL_SMTP_PRE} /var/qmail/bin/qmail-${SERVICE}d ${QMAIL_SMTP_POST} \ 2>&1 which, frankly, I think matches with this error: ${TCPSERVER_PORT} is passed on the command line, and if it's undefined nothing is passed. Shouldn't ${SERVICE} be used instead/also? This is just my 2 cents, it's the first time I explore these files. ;) Thanks, Michele.
the qmail-smtpd startup script (as you posted) sets SERVICE=smtp and sources qmail-config-system qmail-config-system sources conf-common and then sources conf-smtpd. conf-common does: TCPSERVER_PORT="${SERVICE}" amongst other things. when control gets back to the smtpd run script, all of the variables are suitably set. you're the first to find any problem with this. On a hunch, did you have an old version of qmail previously, and miss etc-update on some files perhaps? Versions should be as follows: "grep Header /var/qmail/control/conf*" conf-common:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-common,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ conf-pop3d:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-pop3d,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ conf-qmqpd:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-qmqpd,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ conf-qmtpd:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-qmtpd,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ conf-send:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-send,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ conf-smtpd:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-smtpd,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ for another test, get your system back to the point where it gives you the same error as before, and modify the smtpd run file as such: 1. replace 'exec' with 'echo' 2. new line on the end 'sleep 600' now start up svscan again to run the script, and look at the log file for the output of the echo statement, and report that back here.
I took further investigation, after you latest comment, into /var/qmail/supervise/qmail-smtpd/run and I found out that the command line it launches is: /usr/bin/softlimit -m 8000000 /usr/bin/tcpserver -p -v -R -x /etc/tcprules.d/tcp.qmail-smtp.cdb -c 40 -u 201 -g 200 0.0.0.0 smtp /var/qmail/bin/qmail-smtpd which doesn't work unless I substitute "smtp" with "25" *OR* do: /usr/bin/softlimit /usr/bin/tcpserver -p -v -R -x /etc/tcprules.d/tcp.qmail-smtp.cdb -c 40 -u 201 -g 200 0.0.0.0 smtp /var/qmail/bin/qmail-smtpd That is to say that it's the "-m 8000000" parameter which breaks the interpreation of the "smtp" word. It seems quite strange but that's what happens! Michele.
are you certain your config files are the most recent versions as I listed? if you are sure, we need to pursue a different route, so please do: "tar cvfz /tmp/broken-qmail.tgz /var/qmail" and attach that file here for me to examine.
I think the versions are the latest (1.2 2004/07/18 03:29:51): /var/qmail/control/conf-common:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/c onf-common,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ /var/qmail/control/conf-pop3d:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/co nf-pop3d,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ /var/qmail/control/conf-qmqpd:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/co nf-qmqpd,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ /var/qmail/control/conf-qmtpd:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/co nf-qmtpd,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ /var/qmail/control/conf-send:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/con f-send,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ /var/qmail/control/conf-smtpd:# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/co nf-smtpd,v 1.2 2004/07/18 03:29:51 dragonheart Exp $ I'm attaching you the tarball via email. Michele.
Hi, I have the same problem with qmail and i skirted this adding the line TCPSERVER_PORT=`cat /etc/services | tr -s '\t' ' ' | grep "^${SERVICE} " | grep tcp | cut -d ' ' -f 2 | cut -d '/' -f 1` to /service/qmail-*/run Att Fernando Hallberg
Please use the latest ucspi-tcp (r9), it is fixed there. If it isn't, please reassign this bug to amd64.
Still doesn't work on AMD64, with the latest ucspi-tcp tools installed.
I'm going to test this on amd64.
I am really, really sorry. I was thinking about another error that happened with tcpserver, as described in bug 18892. I manually patched and compiled ucspi-tcp on AMD64 and it worked there. Giving over to AMD64 as this might be a problem with your libs or something.
amd64: see comment #8 about the "-m 8000000" parameter breaking softlimit.
I have a similar problem with my athlon64 (not sure if it's the same). If I add TCPSERVER_PORT=25 and TCPSERVER_HOST=0.0.0.0 to conf-common I get: tcpserver: fatal: temporarily unable to figure out IP address for 0.0.0.0: file does not exist And if I running: # tcpserver localhost 25 /usr/bin/printenv tcpserver: fatal: temporarily unable to figure out IP address for localhost: file does not exist
varelagarrido: Please see that the results of 'getent hosts localhost' are sane.
I think the problem here is that whatever tcpserver is trying to use to translate smtp into 25 is taking up too much memory. The softlimit command will just kill the process if it takes up too much memory (will kill the getent program, or whatever is doing the lookup). I had the same problem as above, and fixed it the same way as above, but still had problems (qmail-smtpd disconnecting as soon as I telnetted to port 25). Bumping up the memory limit to 16MB solved all of the problems. I think that the memory consumption under amd64 is higher, and the 8MB limit is being hit too frequently. Perhaps bumping the softlimit to 16MB for amd64 systems is appropriate?
Ok, I bumped the default memory limit to 16MB for softlimit now.