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>
Subject: qpsmtpd-forkserver on Mac OS X
Date: Mon, 5 Jun 2006 17:58:17 +0900	[thread overview]
Message-ID: <ACC1EED2-BDE8-4A61-8A9E-77C96FAFAD58@seespotcode.net> (raw)

Hello!

I'm trying to get qpsmtpd-forkserver[1] to start automatically on  
server restart.

Mac OS X 10.4.6 (Intel Mac Mini)
runit-1.5.1
qpsmtpd-0.32 -- An easily extensible smtp server written in Perl.

 From what I can tell, the qpsmtpd installation is working fine, and  
the runit installation is okay. However, using the two together  
doesn't seem to work. Details of my configuration are below. I've  
googled and looked through the documentation on using runit with  
qpsmtpd [2] and runit with launchd [3], but am at a loss as to what I  
have misconfigured.

I've posted this to the runit mailing list first, as it appears that  
my qpstmpd installation is okay. If it looks like it's a qpstmpd  
configuration problem, I'll definitely ask there as well.

Any hints or suggestions on what else I might check in my  
configuration, or where I might find additional information is  
appreciated. If there's any information about the setup I can provide  
to make it easier to diagnose, please let me know.

Thanks!

Michael Glaesemann
grzm seespotcode net

[1](http://smtpd.develooper.com/)
[2](http://wiki.qpsmtpd.org/runit)
[3] (http://smarden.org/runit/useinit.html#macosx)

-----

I can run the qpstmpd-forkserver from the command line using

sudo /usr/local/qpsmtpd/qpsmtpd-forkserver --detach --user www --port 25

After launching the qpsmtpd-forkserver from the command line, I can  
connect to the smtp server via telnet:

$ telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 wilde.local ESMTP qpsmtpd 0.32 ready; send us your mail, but not  
your spam.

The server also delivers mail as expected when launched from the  
command line.

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
$

I've installed runit according to the instructions, including the  
modifications for installation on Mac OS X (modifications to src/conf- 
ld and src/Makefile)

  Installation appeared to go fine. I saw no errors at the end of the  
installation script.

$ ls -la /sbin/runsvdir-start
-rwxr-x---   1 root  wheel  554 Jun  5 11:17 /sbin/runsvdir-start

$ ls -la /var/service/qpsmtpd/
total 8
drwxr-xr-x   5 root      wheel  170 Jun  5 17:19 .
drwxr-xr-x   3 root      wheel  102 Jun  5 11:24 ..
drwxr-xr-x   3 root      wheel  102 Jun  5 17:20 log
-rwxr-xr-x   1 saiadmin  wheel   99 Jun  5 13:08 run
drwx------   8 root      wheel  272 Jun  5 17:52 supervise

/var/service/qpsmtpd/supervise was created automatically and I can  
see that the modification time is incrementing. This is why I think  
runit is properly installed.

$ cat /var/service/qpsmtpd/run
#!/bin/bash
unset PERL_UNICODE
/usr/local/qpsmtpd/qpsmtpd-forkserver --detach --user www --port 25
wilde:/usr/local/qpsmtpd saiadmin$

$ cat /Library/LaunchDaemons/org.smarden.runit.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// 
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
         <key>Label</key>
         <string>org.smarden.runit</string>
         <key>ServiceDescription</key>
         <string>runsvdir - starts and monitors a collection of runsv 
(8) processes</string>
         <key>QueueDirectories</key>
         <array>
                 <string>/var/service</string>
         </array>
         <key>OnDemand</key>
         <false/>
         <key>Disabled</key>
         <false/>
         <key>ProgramArguments</key>
         <array>
                 <string>/sbin/runsvdir-start</string>
         </array>
</dict>
</plist>
$

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:

$ netstat -atn | grep -e '\.25'
tcp4       0      0  *.25                   *.*                     
LISTEN
$

Connecting via telnet fails:
$ telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
$

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.)



             reply	other threads:[~2006-06-05  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05  8:58 Michael Glaesemann [this message]
2006-06-06 15:57 ` Gerrit Pape
2006-06-07  3:36   ` Michael Glaesemann
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=ACC1EED2-BDE8-4A61-8A9E-77C96FAFAD58@seespotcode.net \
    --to=grzm@seespotcode.net \
    /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).