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

Cannot save to Systemd #35

Open
richieri opened this issue Nov 24, 2023 · 2 comments
Open

Cannot save to Systemd #35

richieri opened this issue Nov 24, 2023 · 2 comments

Comments

@richieri
Copy link

richieri commented Nov 24, 2023

Hello!

I'm getting the following error from cameractrls.cameractrlsgtk when trying to click on Save (save settings to systemd):

Traceback (most recent call last):
  File "/snap/cameractrls/31/usr/bin/cameractrlsgtk.py", line 340, in <lambda>
    b.connect('clicked', lambda e, c=c, m=m: self.update_ctrl(c, m.text_id))
  File "/snap/cameractrls/31/usr/bin/cameractrlsgtk.py", line 429, in update_ctrl
    self.camera.setup_ctrls({ctrl.text_id: value}, errs)
  File "/snap/cameractrls/31/usr/bin/cameractrls.py", line 2244, in setup_ctrls
    c.setup_ctrls(params, errs)
  File "/snap/cameractrls/31/usr/bin/cameractrls.py", line 2131, in setup_ctrls
    self.create_systemd_service_and_path()
  File "/snap/cameractrls/31/usr/bin/cameractrls.py", line 2155, in create_systemd_service_and_path
    subprocess.run(["systemctl", "--user", "enable", "--now", service_file])
  File "/usr/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'systemctl'

Ubuntu 22.04
Version: 0.5.11-0
Installed from Ubuntu Software with snap

@nestpana
Copy link

nestpana commented Jan 9, 2024

same

@mikegleasonjr
Copy link

Same, some more logs regarding apparmor:

Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]: Traceback (most recent call last):
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/snap/cameractrls/31/usr/bin/cameractrlsgtk.py", line 340, in <lambda>
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     b.connect('clicked', lambda e, c=c, m=m: self.update_ctrl(c, m.text_id))
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/snap/cameractrls/31/usr/bin/cameractrlsgtk.py", line 429, in update_ctrl
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     self.camera.setup_ctrls({ctrl.text_id: value}, errs)
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/snap/cameractrls/31/usr/bin/cameractrls.py", line 2244, in setup_ctrls
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     c.setup_ctrls(params, errs)
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/snap/cameractrls/31/usr/bin/cameractrls.py", line 2131, in setup_ctrls
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     self.create_systemd_service_and_path()
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/snap/cameractrls/31/usr/bin/cameractrls.py", line 2155, in create_systemd_service_and_path
Feb 20 10:27:52 computer kernel: [  851.676752] audit: type=1400 audit(1708421272.881:119): apparmor="DENIED" operation="exec" class="file" profile="snap.cameractrls.cameractrlsgtk" name="/usr/bin/systemctl" pid=17448 comm="python3" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
Feb 20 10:27:52 computer kernel: [  851.676911] audit: type=1400 audit(1708421272.881:120): apparmor="DENIED" operation="exec" class="file" profile="snap.cameractrls.cameractrlsgtk" name="/usr/bin/systemctl" pid=17448 comm="python3" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     subprocess.run(["systemctl", "--user", "enable", "--now", service_file])
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/usr/lib/python3.10/subprocess.py", line 503, in run
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     with Popen(*popenargs, **kwargs) as process:
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     self._execute_child(args, executable, preexec_fn, close_fds,
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:   File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]:     raise child_exception_type(errno_num, err_msg, err_filename)
Feb 20 10:27:52 computer cameractrls_cameractrlsgtk.desktop[17294]: PermissionError: [Errno 13] Permission denied: 'systemctl'

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

3 participants