Hi,
When starting mailman in a terminal, then it works:
--8<---------------cut here---------------start------------->8--- $ mailman start Starting Mailman's master runner $ --8<---------------cut here---------------end--------------->8---
But from "cron", it seems to hang. Output of pstree:
--8<---------------cut here---------------start------------->8--- |-cron(3022)---cron(21962)-+-mailman(21986) | `-sendmail(22043)---postdrop(22044) --8<---------------cut here---------------end--------------->8---
So it seems, that mailman does not go into the background, and the email with the output is never sent...
How could I solve this issue please?
TIA for any hints,
Peter
On Tue, Feb 13, 2018, at 5:40 AM, Peter Münster wrote:
Hi,
When starting mailman in a terminal, then it works:
--8<---------------cut here---------------start------------->8--- $ mailman start Starting Mailman's master runner $ --8<---------------cut here---------------end--------------->8---
But from "cron", it seems to hang. Output of pstree:
--8<---------------cut here---------------start------------->8--- |-cron(3022)---cron(21962)-+-mailman(21986) | `-sendmail(22043)---postdrop(22044) --8<---------------cut here---------------end--------------->8---
So it seems, that mailman does not go into the background, and the email with the output is never sent...
How could I solve this issue please?
I looked at this Stackoverflow Question1 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.
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.
TIA for any hints,
Peter
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Abhilash Raj maxking@asynchronous.in
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
On 02/13/2018 05:40 AM, Peter Münster wrote:
Hi,
When starting mailman in a terminal, then it works:
--8<---------------cut here---------------start------------->8--- $ mailman start Starting Mailman's master runner $ --8<---------------cut here---------------end--------------->8---
But from "cron", it seems to hang. Output of pstree:
--8<---------------cut here---------------start------------->8--- |-cron(3022)---cron(21962)-+-mailman(21986) | `-sendmail(22043)---postdrop(22044) --8<---------------cut here---------------end--------------->8---
So it seems, that mailman does not go into the background, and the email with the output is never sent...
I think Abhilash's answer is probably closer to the mark, but there can be issues with running 'mailman' from cron or init scripts which don't set a UTF-8 compatible LANG in the environment as described at <http://mailman.readthedocs.io/en/latest/src/mailman/docs/install.html#runnin...>.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Abhilash Raj
-
Mark Sapiro
-
Peter Münster