MailmanWiki

4.54. How do I get qrunner to run under daemontools?

It is possible to run qrunner under daemontools, but you have to do a little setup. Because of the fact that mailmanctl forks, you can't use it to start and stop the qrunner processes under daemontools. The solution is to run /usr/local/mailman/bin/qrunner directly.

Please keep in mind that this means you won't be able to use mailmanctl to start and stop Mailman. You will need to use daemontools to manage that part of your job, and the standard solutions recommended by others may not be applicable to you if they depend on using mailmanctl for this function.

To start, create a directory called /usr/local/mailman/supervise:

 mkdir /usr/local/mailman/supervise

We will need two scripts in this directory. The first should be called /usr/local/mailman/supervise/run, and should contain the following text:

 #!/bin/sh
 exec setuidgid mailman ./qrunner

Now, create /usr/local/mailman/supervise/qrunner with the following text:

 #!/bin/sh
 # execute a pass through the queues once per minute
 while `/bin/true`; do
    # perhaps code to check for and remove locks should go here???
    /usr/local/mailman/bin/qrunner --runner=All --once
    sleep 60
 done

We should fix up the permissions on this directory now. This is not strictly necessary, but it will stop check_perms from complaining:

 cd /usr/local/mailman
 chmod 2755 supervise
 chmod 755 supervise/*
 chown mailman:mailman supervise -R

Finally, just link /usr/local/mailman/supervise into your /service directory:

 ln -s /usr/local/mailman/supervise/ /service

The qrunner process should start within 5 seconds. Use svstat to verify things are working properly.

Converted from the Mailman FAQ Wizard

This is one of many Frequently Asked Questions.

MailmanWiki: DOC/4.54 How do I get qrunner to run under daemontools? (last edited 2015-02-16 00:55:53 by JimTittsler)