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

Can't get user in daemon extension #401

Closed
qs opened this issue Aug 2, 2016 · 1 comment
Closed

Can't get user in daemon extension #401

qs opened this issue Aug 2, 2016 · 1 comment

Comments

@qs
Copy link

qs commented Aug 2, 2016

Example code from here http://cement.readthedocs.io/en/latest/api/ext/ext_daemon/#usage doesn't work form python2 on ubuntu 14.04

Running from CLI:

Traceback (most recent call last):
  File "runner.py", line 65, in <module>
    with MyApp() as app:
  File "/usr/local/lib/python2.7/dist-packages/cement/core/foundation.py", line 1494, in __enter__
    self.setup()
  File "/usr/local/lib/python2.7/dist-packages/cement/core/foundation.py", line 860, in setup
    for res in self.hook.run('post_setup', self):
  File "/usr/local/lib/python2.7/dist-packages/cement/core/hook.py", line 150, in run
    res = hook[2](*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cement/ext/ext_daemon.py", line 377, in extend_app
    user = pwd.getpwnam(os.getlogin())
OSError: [Errno 2] No such file or directory

Running from PyCharm:

Traceback (most recent call last):
  File "runner.py", line 65, in <module>
    with MyApp() as app:
  File "/usr/local/lib/python2.7/dist-packages/cement/core/foundation.py", line 1494, in __enter__
    self.setup()
  File "/usr/local/lib/python2.7/dist-packages/cement/core/foundation.py", line 860, in setup
    for res in self.hook.run('post_setup', self):
  File "/usr/local/lib/python2.7/dist-packages/cement/core/hook.py", line 150, in run
    res = hook[2](*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cement/ext/ext_daemon.py", line 377, in extend_app
    user = pwd.getpwnam(os.getlogin())
OSError: [Errno 25] Inappropriate ioctl for device
@derks
Copy link
Member

derks commented Aug 2, 2016

I ran into this issue last week, but hadn't had a chance to work on it. It's hit others aswell:

The pull request is exactly the direction I was going to go with it, so thank you for that! I'm traveling this week, but will work on pushing this out to stable branch next week.

derks added a commit that referenced this issue Aug 2, 2016
Fix getting os user for daemon extension #401
@derks derks self-assigned this Aug 2, 2016
@derks derks added this to the 2.10.4 Stable milestone Aug 2, 2016
@derks derks added 1 - Ready and removed 1 - Ready labels Nov 23, 2016
@derks derks closed this as completed Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants