On Jun 6, 2006, at 11:13 , John Peacock wrote:
Michael Glaesemann wrote:
$ cat /var/service/qpsmtpd/run
#!/bin/bash
unset PERL_UNICODE
/usr/local/qpsmtpd/qpsmtpd-forkserver --detach --user www --port 25
I seriously doubt that run script is correct.
Thanks for looking at this. I didn't even know about the --detach
option until I looked at the qpstmpd wiki, where it includes this
option for the runit run script.
http://wiki.qpsmtpd.org/runit
I've taken it out --detach and tried running it again.
Both daemontools and runit are
intended to maintain a *foreground* application and redirect its
STDOUT/STDERR
to the log daemon. The run script should never exit while the
qpsmtpd process
is running.
Thanks for this explanation. I'm new to runit (and qpsmtpd for that
matter), so this is helpful.
Remove the '--detach' option from the command line and try and
start the daemon
again.
When you say "daemon" here, are you referring to the qpsmptd process
or the runit process (or something else)? My understanding is runit
process is the one that needs to be restarted, which I can do by
unloading/loading the appropriate launchd plist.
I don't think this has anything to do with rebooting the server, but
rather the run script is ending and runit's supervisor is
restarting the service
over and over again.
Would that explain why it was disconnecting immediately after
accepting the telnet connection? And just to confirm, this would be a
bad thing, right?
Normally you can spot this by using
$ ps -ef | fgrep qpsmtpd
and seeing if the PID keeps changing.
It looks like there's no -f option on the Mac OS X ps (at least on
10.4.6). One's listed in the ps man page synopsis, but no description
is given.
$ ps -ef | fgrep qpsmtpd
ps: illegal option -- f
usage: ps [-aACcehjlmMrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]
ps [-L]
Being unfamiliar with ps, I googled and found that the -f is for full
listing. Am I missing anything important just using the -e option?
Here's the output I get:
$ ps -e | fgrep qpsmptd
1346 p0 S+ 0:00.00 fgrep qpsmptd TERM=xterm-color SHELL=/bin/
bash SSH_CLIENT=172.16.1.101 57981 22 SSH_TTY=/dev/ttyp0 USER=admin1
MAIL=/var/mail/admin1 PATH=/usr/local/bin:/usr/loca
$
To me it looks like it's just the fgrep qpstmpd process. I get the
same result when launching qpsmtpd from the command line, rather than
via runit. (Nor do I see qpsmtpd in top in either scenario.)
Also, did you choose fgrep qpstmpd to look for a process named
qpsmtpd? I'm wondering if it's not showing up because its parent
process is perl? (Though, similarly, I don't get any output from ps
other than the fgrep perl process) Looking at top, I do see there is
a perl process owed by www with rapidly changing pids (or rather, a
rapid sequence of perl processes owed by www).
Personally, I wouldn't reuse the www user for a completely different
application; UID's are cheap on most server machines (i.e. you
don't have a lot
of users floating around).
Normally I wouldn't reuse a user like this. I'm using qpsmtpd in
conjunction with Bricolage[1] to automate some Bricolage tasks. For
ease of permissions handling, I have qpsmtpd running as the same user
as Bricolage. This machine is dedicated to the Bricolage server: it's
only handling smtp requests from the Bricolage server, rather than in
front of a mail system.
Thanks again for your help!
Michael Glaesemann
grzm seespotcode net
[1](http://bricolage.cc/)