Hello,
With your help, I was able to setup mailman 3.3 on my RHEL 7.5
machine and running well and good.
For daily notification I have added the below line in the crontab:
00 08 * * * /var/lib/mailman/venv3/bin/mailman notify
But this cron job is not working while I was able to run the same
command manually at my CLI.
Please help if there is any issue with mailman 3.3 or cronjob.
-- Thanks & Regards, Shashi Kanth.K 9052671936
On 1/28/20 3:03 AM, Shashikanth Komandoor wrote:
Hello,
With your help, I was able to setup mailman 3.3 on my RHEL 7.5
machine and running well and good.
For daily notification I have added the below line in the crontab:
00 08 * * * /var/lib/mailman/venv3/bin/mailman notify
But this cron job is not working while I was able to run the same
command manually at my CLI.
Into exactly what crontab did you put it? That is the correct line if you put it in the mailman user's crontab, but if you put it in a system crontag, e.g./etc/cron.d/mailman, it needs a 'user_name' argument between the date/time fields and the commands. E.g.,
00 08 * * * mailman /var/lib/mailman/venv3/bin/mailman notify
although the Mailman user may not be 'mailman' in your case.
You should see some errors from cron in /var/log/syslog at 08:00 that would give you a hint.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thank you Mark Sapiro.
I have tried as per your suggestion but failed unfortunately might be because of my improper setup.
But I learnt one thing and fixed it and would like to share with you so that you may correct me if I am wrong or it would be useful for others.
I observed that the "notify" subcommand can be run only while I am in the /var/lib/mailman/mailman directory where my mailman core is installed (through GITHUB).
And moreover I installed all the components of the mailman using the root user only and so there is no mailman user on my machine.
And hence I wrote the below entry in the crontab directly and found it is working fine.
00 08 * * * cd /var/lib/mailman/mailman; /var/lib/mailman/venv3/bin/python /var/lib/mailman/venv3/bin/mailman notify
Please correct me if my analysis is wrong or please also suggest me if I could work it out in a more optimal manner.
On 1/29/20 12:01 AM, Shashikanth Komandoor wrote:
I observed that the "notify" subcommand can be run only while I am in the /var/lib/mailman/mailman directory where my mailman core is installed (through GITHUB).
I think you mean GitLab, but in any case, the reason for this is you have to be in that directory for the mailman command to find your mailman.cfg file.
I deal with this by creating a separate bin/ directory for these commends, in my case /opt/mailman/mm/bin because Mailman is installed in /opt/mailman/mm/, and my /opt/mailman/mm/bin/mailman file contains
#!/bin/bash
exec /opt/mailman/mm/venv/bin/mailman
-C "/opt/mailman/mm/mailman.cfg"
$@
And moreover I installed all the components of the mailman using the root user only and so there is no mailman user on my machine.
And hence I wrote the below entry in the crontab directly and found it is working fine.
00 08 * * * cd /var/lib/mailman/mailman; /var/lib/mailman/venv3/bin/python /var/lib/mailman/venv3/bin/mailman notify
The /var/lib/mailman/venv3/bin/python is probably not needed as /var/lib/mailman/venv3/bin/mailman should contain the shebang line
#!/var/lib/mailman/venv3/bin/python
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Mark Sapiro
-
Shashikanth Komandoor