In the advanced deployment instructions 
(https://mayan.readthedocs.io/en/2.7/topics/deploying.html), the current 
setup starts UWSGI as root, and beat + worker as the www-data user.

This seems to be problematic, at least on Ubuntu 16.04. The lockfile at 
/tmp/mayan_locks.tmp is mode 0644 and belongs to root:root. Because of 
that, the worker and beat fail to start since they run as www-data and 
can't access the lock.

I'm seeing this in the wroker-stderr log:
Traceback (most recent call last):
  File "/usr/share/mayan-edms/bin/mayan-edms.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 367, in execute_from_command_line
    utility.execute()
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 341, in execute
    django.setup()
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/__init__.py", 
line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py",
 
line 85, in populate
    app_config = AppConfig.create(entry)
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/config.py",
 
line 116, in create
    mod = import_module(mod_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/checkouts/apps.py",
 
line 29, in <module>
    from .tasks import task_check_expired_check_outs  # NOQA
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/checkouts/tasks.py",
 
line 8, in <module>
    from lock_manager.runtime import locking_backend
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/lock_manager/runtime.py",
 
line 5, in <module>
    locking_backend = import_string(setting_backend.value)
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/utils/module_loading.py",
 
line 20, in import_string
    module = import_module(module_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File 
"/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/lock_manager/backends/file_lock.py",
 
line 25, in <module>
    open(lock_file, 'a').close()
IOError: [Errno 13] Permission denied: u'/tmp/mayan_locks.tmp'

A workaround is to run beat and worker under the root user (by changing the 
user in the config files), but that probably isn't a good thing since 
they're user facing.

Am I overlooking something, or is it an error in the instructions?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to