Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong log file owner when exaproxy started by root and exaproxy.daemon.user is not root #45

Open
cyril-s opened this issue Mar 16, 2017 · 1 comment

Comments

@cyril-s
Copy link

cyril-s commented Mar 16, 2017

When exaproxy is started by root, it creates log files specified in exaproxy.log.destination and exaproxy.usage.destination but does not do chown to exaproxy.daemon.user, which results in the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/exaproxy/lib/exaproxy/util/debug.py", line 71, in <module>
    execfile(sys.argv[0])
  File "/opt/exaproxy/lib/exaproxy/application.py", line 327, in <module>
    main()
  File "/opt/exaproxy/lib/exaproxy/application.py", line 297, in main
    Supervisor(configuration).run()
  File "/opt/exaproxy/lib/exaproxy/supervisor.py", line 133, in __init__
    redirector = fork_redirector(self.poller, self.configuration)
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/__init__.py", line 34, in fork_redirector
    supervisor = RedirectorSupervisor(configuration, messagebox, controlbox)
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/supervisor.py", line 25, in __init__
    self.log_writer = SysLogWriter('log', configuration.log.destination, configuration.log.enable, level=configuration.log.level)
  File "/opt/exaproxy/lib/exaproxy/util/log/writer.py", line 107, in __init__
    _handler = self.getHandler(destination)
  File "/opt/exaproxy/lib/exaproxy/util/log/writer.py", line 147, in getHandler
    handler = logging.handlers.RotatingFileHandler(destination, maxBytes=5*1024*1024, backupCount=5)
  File "/usr/lib/python2.7/logging/handlers.py", line 117, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/handlers.py", line 64, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/__init__.py", line 911, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 936, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/exaproxy/exaproxy.log'

and

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/exaproxy/lib/exaproxy/util/debug.py", line 71, in <module>
    execfile(sys.argv[0])
  File "/opt/exaproxy/lib/exaproxy/application.py", line 327, in <module>
    main()
  File "/opt/exaproxy/lib/exaproxy/application.py", line 297, in main
    Supervisor(configuration).run()
  File "/opt/exaproxy/lib/exaproxy/supervisor.py", line 173, in __init__
    self.redirector.requestStats()
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/dispatch.py", line 61, in requestStats
    return self.messagebox.requestStats()
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/messagebox.py", line 49, in requestStats
    identifier = self.control.send('STATS')
  File "/opt/exaproxy/lib/exaproxy/util/control.py", line 20, in send
    self.box.put((identifier, command, args))
  File "/opt/exaproxy/lib/exaproxy/util/messagebox.py", line 103, in put
    raise e
IOError: [Errno 32] Broken pipe

Occurred on: Linux proxy-eu 3.16.0-4-amd64 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux

@thomas-mangin
Copy link
Member

Indeed an issue to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants