Re: tcpserver won't start smtp]


Subject: Re: tcpserver won't start smtp]
From: Patrick Callahan (pac1@tiac.net)
Date: Wed Jan 26 2000 - 18:17:55 MST


Paul Schinder wrote:

> At 7:14 AM -0500 1/26/00, Patrick Callahan wrote:
> >I'm sure this is some dumb user configuration error or typo.
>
> Hard to see what though, since you've found Dave Sill's "Life with
> qmail", unless you've forgotten to make one of qmail's users or
> groups.

90:2108::/var/qmail/alias:/bin/true
qmaild:x:7791:2108::/var/qmail:/bin/true
qmaill:x:7792:2108::/var/qmail:/bin/true
qmailp:x:7793:2108::/var/qmail:/bin/true
qmailq:x:7794:2107::/var/qmail:/bin/true
qmailr:x:7795:2107::/var/qmail:/bin/true
qmails:x:7796:2107::/var/qmail:/bin/true

>

> My own machine lives close to the bleeding edge, but my
> wife's machine is stock YDL CS 1.1, and qmail and tcpserver (and
> daemontools etc.) are running fine there.

Good Information to have. It means I made a mistake somewhere.

>
> >#!/bin/sh
> >QMAILDUID=`id -u qmaild`
> >NOFILESGID=`id -g qmaild`
> >exec /usr/local/bin/softlimit -m 2000000 \
> > /usr/local/bin/tcpserver -v -p -x /etc/tcp.smtp.cdb \
> > -u $QMAILDUID -g $NOFILESGID 0 smtp /var/qmail/bin/qmail-smtpd
> >2>&1
>
> OK, that looks right, so long as QMAILDUID and NOFILESGID are
> defined.

[root@localhost pac1]# QMAILDUID=`id -u qmaild`
[root@localhost pac1]# NOFILESGID=`id -g qmaild`
[root@localhost pac1]# echo $QMAILDUID
7791
[root@localhost pac1]# echo $NOFILESGID
2108

> A common mistake is to have something missing so that it's
> not looking up a service named "smtp" but one named, say,
> "/var/qmail/bin/qmail-smtpd". So long as you're using Dave Sill's
> stuff, you can't go wrong so far as syntax is concerned. You might
> want to make sure that the two "id" commands give the right result
> (or *a* result) by running the above once by hand.
>
> What does
>
> #include <netdb.h>
> #include <stdio.h>
> main () {
> struct servent *i;
> i = getservbyname("smtp","tcp");
> printf ("%d\n",i->s_port);
> }
>
> give? (Or actually, even better
>
> #!/usr/bin/perl -w
> print +(getservbyname("smtp","tcp"))[2],"\n";
>
> since it will use the same call and won't need to be compiled.) Of
> course, both give "25" on my machines.
>

Both return 25! This means that the call inside tcpserver is not being fed
the right stuff. So somewhere between the start up which when run from the
command line also gets the error and the call to tcpserver inside softlimit
some parameter or other gets lost.

taking apart the /var/qmail/supervise/qmail-smtpd/run file showed that the
tcpserver command, as written executes adn tcpserver is a process while it
is running from the command prompt. The problem, whatever it is is now
limited to exec /usr/local/bin/softlimit -m 2000000 \ and its interaction
with the rest of the command line.
The problem is not in the tcpserver or getservbyname but in tcpserver's
caller, softlimit, part of the daemontools library.
-entering newbie mode:

At this point, I think I need to learn how to create a debug version of a
package and use gdb to see what's going on inside it. Specifically,
softlimit and maybe tcpserver. If there's a short list of make commands
and other to compile and execute daemontools or any other package in debug
somewhere, I'd like a pointer to it so I can go off and read it. I haven't
stumbled into it yet. I'm supposing that you just touch softlimit.c and do
a make with a special parameter (-g comes to mind) and then run the
executables right out of the build directories - is this right or is it more
complex because tcpserver is in a different package?

- exit newbie mode

Pat Callahan

Acton Ma USA
Programmer and Kohlrabi Rancher




This archive was generated by hypermail 2a24 : Tue Feb 01 2000 - 17:50:59 MST