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

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 posted this to the runit mailing list first, but haven't received any response yet. My hope is that someone here may have an idea how I may get this working.

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 via email to