[Pymilter] Milter as a daemon?

Stuart Gathman stuart at gathman.org
Thu Jun 22 18:51:26 EDT 2017


On 06/22/2017 06:15 PM, Michael Munger wrote:
> I have written a milter that works when run from the command line
> (directly). I was refactoring it to be a python-daemon compatible
> daemon for this mail server, but I have hit a snag:
>
....
>
> I cannot figure out where the next path in the code execution is. I
> think we just hand it off to libmilter, but not sure. I am 99.9% done
> with this little project, and if I can just get this thing to run as a
> daemon, there will be much rejoicing.
Milter.runmilter() does indeed hand off to libmilter, and will not
return until shutdown.  I'm not sure what python-daemon does, but it may
be incompatible with libmilter.  If your milter runs started by hand,
then just use daemon to start it:

daemon --check ${prog} --pidfile "${piddir}/${prog}.pid" --user mail \
        daemonize -a -e "${logdir}/${prog}.log" -o "${logdir}/${prog}.log" \
                -c "${workdir}" -p "${piddir}/${prog}.pid" \
                /usr/bin/${python} ${script}.py

Is this for systemd or sysvinit ? 





More information about the Pymilter mailing list