On Tue, Feb 13 2018, Abhilash Raj wrote:
I looked at this Stackoverflow Question[1] about why forked processes don't work properly with cron. It essentially says that because cron doesn't reap child processes, the Mailman daemon is stuck.
Thanks, that helped to understand. Now I use this solution (script /usr/local/bin/mailman-cron.sh):
--8<---------------cut here---------------start------------->8---
#!/bin/bash
if ! mailman status | grep -q "GNU Mailman is running"; then
OUT=mktemp
mailman start &>$OUT &
sleep 10
cat $OUT
rm -f $OUT
fi
exit 0
--8<---------------cut here---------------end--------------->8---
You can directly invoke the Mailman's master runner, which is what Mailman does, by running
master start
from cron. This will not fork into background, so it should work fine.
No, because it *must* go into background. When mailman starts, I want a message from cron.
-- Peter