Package: courier-mta Version: 0.61.2-1 Severity: wishlist Hi,
I'd like to run all components of courier under runit (which is a System V init replacement and/or a service management package). Some context: Runit avoids many problems related to daemonised processes (mostly the pid guessing game and unnecessary complexity in initscripts) by keeping daemons in the foreground, each running as the child of a 'runsv' process that manages its child. Each service has a so-called 'run' script that's started by the runsv process and that's responsible for setting up the initial environment of the service, then exec the service so that the process which started out as the shell running the run script doesn't exit as long as the service doesn't. The runsv process can then be told to send signals to the service or to automatically restart it when it exits. Logging is also provided: runsv can open a pipe between the stdout of the run script and the stdin of a logging process. This has advantages and disadvantages compared to the traditional syslog approach which I won't go into here. The point is, all this works beautifully with courier-imap and courier-authdaemon; it also appears to work with courierd itself, with the following 'run' script: --- snip --- #!/bin/sh exec 2>&1 set -a . /etc/courier/courierd exec /usr/lib/courier/courier/courierd --- snip --- (I'm not yet sure what happens to courierd's log messages in this case.) However, I couldn't find a way to start courierfilter so that it stays in the foreground and preferably logs errors to stdout or stderr. Looking at the source, I get the impression that the program goes out of its way to daemonise and start a separate logging process, neither of which can apparently be disabled. Unfortunately I don't have what it takes to plough through liblock and implement a clean solution for staying in the foreground and logging to stderr, so I'm sending this wishlist report instead. Ideally, there should probably be a command line option or an envvar that disables daemonisation and another one that causes log messages to go to stderr, but for me and other users of similar init replacements a single option that does both would suffice. People wanting to use daemontools or freedt with courier would face the same issue, as would those who'd like to start courierfilter from inittab for whatever reason. Andras -- Andras Korn <korn at chardonnay.math.bme.hu> <http://chardonnay.math.bme.hu/~korn/> QOTD: Can February March? No, but April May... -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org