[GH-ISSUE #1850] /etc/crontab uses system python #1450

Closed
opened 2026-02-27 11:17:10 +03:00 by kerem · 2 comments
Owner

Originally created by @MertsA on GitHub (Feb 24, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1850

Impacted versions

  • Modoboa: 1.14.0
  • installer used: Yes/No ? yes
  • Webserver: Nginx

Steps to reproduce

install Modoboa

Current behavior

/etc/crontab contains

  •   *       *       *       *       root    python /srv/modoboa/instance/manage.py modo manage_dkim_keys
    

Expected behavior

/etc/crontab contains

  •   *       *       *       *       root    /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py modo manage_dkim_keys
    

Should probably just be moved in with /etc/cron.d/modoboa, not really sure why the DKIM cron job gets put straight in /etc/crontab

Originally created by @MertsA on GitHub (Feb 24, 2020). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1850 # Impacted versions * Modoboa: 1.14.0 * installer used: Yes/No ? yes * Webserver: Nginx # Steps to reproduce install Modoboa # Current behavior /etc/crontab contains * * * * * root python /srv/modoboa/instance/manage.py modo manage_dkim_keys # Expected behavior /etc/crontab contains * * * * * root /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py modo manage_dkim_keys Should probably just be moved in with /etc/cron.d/modoboa, not really sure why the DKIM cron job gets put straight in /etc/crontab
kerem closed this issue 2026-02-27 11:17:11 +03:00
Author
Owner

@MertsA commented on GitHub (Feb 24, 2020):

Oh and the reason why this is an issue is because without using python from the right env you of course get something like this.

Traceback (most recent call last):
File "/srv/modoboa/instance/manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 338, in execute
django.setup()
File "/usr/lib64/python2.7/site-packages/django/init.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib64/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/lib64/python2.7/site-packages/django/apps/config.py", line 127, in create
import_module(entry)
File "/usr/lib64/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named dnstools

<!-- gh-comment-id:590353050 --> @MertsA commented on GitHub (Feb 24, 2020): Oh and the reason why this is an issue is because without using python from the right env you of course get something like this. Traceback (most recent call last): File "/srv/modoboa/instance/manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/usr/lib64/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line utility.execute() File "/usr/lib64/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute django.setup() File "/usr/lib64/python2.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/lib64/python2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/usr/lib64/python2.7/site-packages/django/apps/config.py", line 127, in create import_module(entry) File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named dnstools
Author
Owner

@MertsA commented on GitHub (Feb 24, 2020):

Nevermind, looks like this must be a holdover from when I originally installed Modoboa. The current install directions do exactly that.

<!-- gh-comment-id:590367590 --> @MertsA commented on GitHub (Feb 24, 2020): Nevermind, looks like this must be a holdover from when I originally installed Modoboa. The current install directions do exactly that.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1450
No description provided.