Coder Social home page Coder Social logo

Comments (8)

mmstick avatar mmstick commented on May 14, 2024 1

I'll add a fix for this alongside the existing PR

from system76-scheduler.

mjakeman avatar mjakeman commented on May 14, 2024

Hi, I'm also experiencing this issue as part of my attempt at a standalone shell extension. As it's effectively the same implementation as pop-shell, I'm wondering if this is an issue with my extension rather than the scheduler itself.

As a temporary workaround, I edited the policy in /etc/dbus-1/system.d/com.system76.Scheduler.conf, although this naturally isn't ideal.

...
<policy context="default">
    <allow send_destination="com.system76.Scheduler"/>
    <allow receive_sender="com.system76.Scheduler"/>
</policy>
...

Would greatly appreciate some clarification on proper usage.

from system76-scheduler.

mmstick avatar mmstick commented on May 14, 2024

Technically you only have to be part of the sudo/adm group right now.

from system76-scheduler.

mmstick avatar mmstick commented on May 14, 2024

You can install from the scheduler branch to have the updated policy.

from system76-scheduler.

WhyNotHugo avatar WhyNotHugo commented on May 14, 2024

Inspecting into internals and setpriority a bit more, it seems you don't actually need to run as root in order to change a process's priority.

So maybe it's best to run this portion of the service as a user service (and use the session dbus instead of the system one); it would suppress the need for the privileged API and having to handle permissions, etc.

from system76-scheduler.

mmstick avatar mmstick commented on May 14, 2024

Root is required to set negative priorities. User accounts can only set 0 and above.

from system76-scheduler.

mjakeman avatar mjakeman commented on May 14, 2024

Hi, I'm encountering an issue with the new policy in #13.

The service is now failing to start with the following error:

org.freedesktop.DBus.Error.AccessDenied: Request to own name refused by policy

By adding back the <allow own="..."> tag to the root user, everything works correctly.

<!DOCTYPE busconfig PUBLIC
          "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
          "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
    <policy context="default">
        <allow send_destination="com.system76.Scheduler"/>
        <allow receive_sender="com.system76.Scheduler"/>
    </policy>
    <policy user="root">
        <allow own="com.system76.Scheduler"/>
        <allow send_destination="com.system76.Scheduler"/>
        <allow receive_sender="com.system76.Scheduler"/>
    </policy>
</busconfig>

For reference, here is the full output from systemctl status:

Feb 23 14:41:54 matthew-s systemd[1]: Starting com.system76.Scheduler.service - Automatically configure CPU scheduler for responsiveness on AC...
Feb 23 14:41:54 matthew-s system76-scheduler[4528]: Error: org.freedesktop.DBus.Error.AccessDenied: Request to own name refused by policy
Feb 23 14:41:54 matthew-s system76-scheduler[4528]: Caused by:
Feb 23 14:41:54 matthew-s system76-scheduler[4528]:     org.freedesktop.DBus.Error.AccessDenied: Request to own name refused by policy
Feb 23 14:41:54 matthew-s systemd[1]: com.system76.Scheduler.service: Main process exited, code=exited, status=1/FAILURE
Feb 23 14:41:54 matthew-s systemd[1]: com.system76.Scheduler.service: Failed with result 'exit-code'.
Feb 23 14:41:54 matthew-s systemd[1]: Failed to start com.system76.Scheduler.service - Automatically configure CPU scheduler for responsiveness on AC.

from system76-scheduler.

KyleGospo avatar KyleGospo commented on May 14, 2024

Seeing the issue above here as well, can confirm their solution.

from system76-scheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.