Re: tcpserver won't start smtp]

Subject: Re: tcpserver won't start smtp]
From: Paul Schinder (
Date: Wed Jan 26 2000 - 18:05:36 MST

At 8:17 PM -0500 1/26/00, Patrick Callahan wrote:
>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.

Interesting. I don't use Sill's scripts myself, and I've never used
softlimit for anything else. Looking at it now, 2 Mb seems like an
awfully small limit. Here's the running tcpserver that handles SMTP
on my machine:

qmaild 372 0.0 0.1 1460 88 ? S Jan22 0:00
pserver -x /usr/local/etc/tcpd.smtp.cdb -v -u 502 -g 501 0 smtp

I wonder if the entire 1460 kB counts agains the 2 Mb limit? I wonder
if a copy of glibc (which seems to be rougnly 1 Mb if size(1) is
right) to get getserv* counts? I wonder if tcpserver can fork()
with that kind of restriction? The documentation is sparse, and I
have no idea how the 2Mb number was obtained. Indeed, doing the
following shows that 2Mb may be too small:

linux% softlimit -m 2000000 ps
ps: error in loading shared libraries: failed to map
segment from sha
red object: Cannot allocate memory

Even that tiny little test program I sent earlier fails with a 1 Mb limit:

linux% softlimit -m 1000000 a.out
a.out: error in loading shared libraries: failed to map segment from
shared object: Cannot allocate memory

You might want to simply get rid of the softlimit call and see if
everything starts up right. If you want to keep it, multiply the
partition by 10 and see what happens.

>-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?

In order to do a comprehensive job, you'd probably have to recompile
both softlimit and tcpserver with -g. However, you should be able to
see what's happening more easily with strace(1), which will show you
all the system calls made. That may be enough to see what's going

>- exit newbie mode
>Pat Callahan
>Acton Ma USA
>Programmer and Kohlrabi Rancher

Paul Schinder

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