supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Michael Glaesemann <grzm@seespotcode.net>
Cc: supervision@list.skarnet.org
Subject: Re: qpsmtpd-forkserver on Mac OS X
Date: Wed, 7 Jun 2006 12:36:48 +0900	[thread overview]
Message-ID: <75C12523-F011-4682-B172-728336E1B739@seespotcode.net> (raw)
In-Reply-To: <20060606155758.32069.qmail@3d2f285f0534b6.315fe32.mid.smarden.org>


On Jun 7, 2006, at 0:57 , Gerrit Pape wrote:

> This may be another problem, independent from what you report:  AFAIK
> the poll() implementation of Mac OSX 10.4/Intel is broken, and doesn't
> work for named pipes.  runit (or better daemontools' iopause()) has an
> alternative implementation using select(), but this isn't chosen while
> building as poll() is available, but broken.

Interesting. Thanks, Gerrit. I didn't save the STDOUT of the  
installation, so I can't easily verify whether it chose select() or  
poll(). However, I can verify that I am able to use runit and launchd  
on this machine to launch a simple Perl script that just logs to syslog.

http://www.nntp.perl.org/group/perl.qpsmtpd/5172

People on the qpstmpd mailing list have been giving me lots of  
helpful suggestions, but no solution yet.

>> The qpsmtpd wiki gives instructions[2] on how to configure qpsmtpd-
>> forkserver with runit. Here's /var/service/qpsmtpd/run
>>
>> $ cat /var/service/qpsmtpd/run
>> #!/bin/bash
>> unset PERL_UNICODE
>> /usr/local/qpsmtpd/qpsmtpd-forkserver --detach --user www --port 25
>> $
>
> The service daemon must not background (or 'daemonize') when  
> supervised
> by runit, but must run in the foreground.  Try to remove the --detach
> option.

Right. This is the same advice I got from the qpsmtpd list. This has  
now been fixed in the run script.

>> When org.smarden.runit.plist is loaded (either manually using
>> launchctl or automatically on server restart), qsmtpd-forkserver
>> doesn't appear to work. However, something is definitely running on
>> port 25:
>
> Maybe you didn't stop the daemon you started before from the command
> line, and which detached from the terminal and process tree, and now
> still listens on the port.

I rebooted the machine to make completely sure there wasn't anything  
else listening on port 25. It looks like for some reason the qpsmptd- 
forkserver server is quitting immediately after being started, and  
runit then restarts it (as expected), only to have the qpsmtp daemon  
quit again. The question now appears to be why the server is  
quitting. The server runs correctly when launched by the run script  
(sudo ./run without the runit service running), but not when  
controlled by runit. :/

>> I don't see anything in /var/log/system.log (where launchd problems
>> are logged) or /var/log/mail.log (the qpsmtpd log). When using
>> launchd/runit, nothing is logged to /var/log/mail.log at all. (When
>> run from the command line, mail.log contains information about
>> connections to the smtp server.)
>
> There should be no difference, I don't know why you get no logs here.

The logging bit is still a bit of a mystery to me as well. Though if  
the qpsmtp daemon is quitting immediately after starting, its not  
going to be accepting connections/have anything to log anyway. That  
would explain the empty logs.

Thanks for your analysis. It confirms things explained on the qpsmptd  
list and is helping my understanding of both qpsmptd and runit.

Cheers,

Michael Glaesemann
grzm seespotcode net



  reply	other threads:[~2006-06-07  3:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05  8:58 Michael Glaesemann
2006-06-06 15:57 ` Gerrit Pape
2006-06-07  3:36   ` Michael Glaesemann [this message]
2006-06-07  9:20     ` Laurent Bercot
2006-06-07  9:54       ` Michael Glaesemann
2006-06-07 12:28         ` Charlie Brady
2006-06-07 13:40           ` Laurent Bercot
2006-10-12  6:56             ` Michael Glaesemann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75C12523-F011-4682-B172-728336E1B739@seespotcode.net \
    --to=grzm@seespotcode.net \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).