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

Exception: Failed to prevent sleep: Permission denied in Linux Mint 22 #296

Open
muziqaz opened this issue Oct 12, 2024 · 11 comments · May be fixed by #297
Open

Exception: Failed to prevent sleep: Permission denied in Linux Mint 22 #296

muziqaz opened this issue Oct 12, 2024 · 11 comments · May be fixed by #297

Comments

@muziqaz
Copy link
Contributor

muziqaz commented Oct 12, 2024

I noticed few messages in the log of my Mint 22. Seems that v8 has lost permissions to prevent sleep in Mint 22.
Mint 21.2 does not show this error message in the logs.
Even though I disabled sleep in my both Linux boxes, I still have Keep Awake ticked in the Settings, just for good measure. Ticks are done on both GPU and CPU resource groups.

@marcosfrm
Copy link
Contributor

Please check if polkitd-pkla is installed (dpkg-query --show polkitd polkitd-pkla). See:

#199 (comment)

@muziqaz
Copy link
Contributor Author

muziqaz commented Oct 12, 2024

Command returns
Mint 22:

polkitd 124-2ubuntu1
polkitd-pkla

Mint 21.2:

polkitd 0.105-33
polkitd-pkla

@marcosfrm
Copy link
Contributor

What client version? (because of e341465)

@muziqaz
Copy link
Contributor Author

muziqaz commented Oct 12, 2024

v8.4.5

@marcosfrm
Copy link
Contributor

Sorry, wrong command. Try dpkg-query -L polkitd polkitd-pkla.

@muziqaz
Copy link
Contributor Author

muziqaz commented Oct 15, 2024

muziqaz2@Linuxm2:~$ dpkg-query -L polkitd polkitd-pkla
/.
/etc
/etc/polkit-1
/etc/polkit-1/rules.d
/etc/xml
/usr
/usr/bin
/usr/bin/pkaction
/usr/bin/pkcheck
/usr/bin/pkttyagent
/usr/lib
/usr/lib/pam.d
/usr/lib/pam.d/polkit-1
/usr/lib/policykit-1
/usr/lib/polkit-1
/usr/lib/polkit-1/polkit-agent-helper-1
/usr/lib/polkit-1/polkitd
/usr/lib/systemd
/usr/lib/systemd/system
/usr/lib/systemd/system/polkit.service
/usr/lib/sysusers.d
/usr/lib/sysusers.d/polkit.conf
/usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/polkitd.conf
/usr/libexec
/usr/share
/usr/share/bug
/usr/share/bug/polkitd
/usr/share/bug/polkitd/control
/usr/share/dbus-1
/usr/share/dbus-1/system-services
/usr/share/dbus-1/system-services/org.freedesktop.PolicyKit1.service
/usr/share/dbus-1/system.d
/usr/share/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
/usr/share/doc
/usr/share/doc/polkitd
/usr/share/doc/polkitd/NEWS.md.gz
/usr/share/doc/polkitd/README.md
/usr/share/doc/polkitd/copyright
/usr/share/doc/polkitd/examples
/usr/share/doc/polkitd/examples/50-local-allow.rules
/usr/share/doc/polkitd/examples/50-local-deny.rules
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/polkitd
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/pkaction.1.gz
/usr/share/man/man1/pkcheck.1.gz
/usr/share/man/man1/pkttyagent.1.gz
/usr/share/man/man8
/usr/share/man/man8/polkit.8.gz
/usr/share/man/man8/polkitd.8.gz
/usr/share/polkit-1
/usr/share/polkit-1/actions
/usr/share/polkit-1/actions/org.freedesktop.policykit.policy
/usr/share/polkit-1/policyconfig-1.dtd
/usr/share/polkit-1/rules.d
/usr/share/polkit-1/rules.d/49-ubuntu-admin.rules
/usr/share/polkit-1/rules.d/50-default.rules
/usr/share/xml
/usr/share/xml/polkit-1
/usr/share/xml/polkit-1/catalog.xml
/var
/var/lib
/var/lib/polkit-1
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/libexec/polkit-agent-helper-1
/usr/share/doc/polkitd/NEWS.Debian.gz
/usr/share/doc/polkitd/changelog.Debian.gz

dpkg-query: package 'polkitd-pkla' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
muziqaz2@Linuxm2:~$ 

Linux Mint 22

@muziqaz
Copy link
Contributor Author

muziqaz commented Oct 15, 2024

muziqaz@mintlinux:~$ dpkg-query -L polkitd polkitd-pkla
/.
/etc
/etc/pam.d
/etc/pam.d/polkit-1
/etc/polkit-1
/etc/polkit-1/localauthority
/etc/polkit-1/localauthority/10-vendor.d
/etc/polkit-1/localauthority/20-org.d
/etc/polkit-1/localauthority/30-site.d
/etc/polkit-1/localauthority/50-local.d
/etc/polkit-1/localauthority/90-mandatory.d
/etc/polkit-1/localauthority.conf.d
/etc/polkit-1/localauthority.conf.d/50-localauthority.conf
/etc/polkit-1/localauthority.conf.d/51-ubuntu-admin.conf
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/polkit.service
/usr
/usr/bin
/usr/bin/pkaction
/usr/bin/pkcheck
/usr/bin/pkttyagent
/usr/lib
/usr/lib/policykit-1
/usr/lib/polkit-1
/usr/libexec
/usr/libexec/polkit-agent-helper-1
/usr/libexec/polkitd
/usr/share
/usr/share/bug
/usr/share/bug/polkitd
/usr/share/bug/polkitd/control
/usr/share/dbus-1
/usr/share/dbus-1/system-services
/usr/share/dbus-1/system-services/org.freedesktop.PolicyKit1.service
/usr/share/dbus-1/system.d
/usr/share/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
/usr/share/doc
/usr/share/doc/polkitd
/usr/share/doc/polkitd/NEWS.gz
/usr/share/doc/polkitd/README
/usr/share/doc/polkitd/copyright
/usr/share/gettext
/usr/share/gettext/its
/usr/share/gettext/its/polkit.its
/usr/share/gettext/its/polkit.loc
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/polkitd
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/pkaction.1.gz
/usr/share/man/man1/pkcheck.1.gz
/usr/share/man/man1/pkttyagent.1.gz
/usr/share/man/man8
/usr/share/man/man8/pklocalauthority.8.gz
/usr/share/man/man8/polkit.8.gz
/usr/share/man/man8/polkitd.8.gz
/usr/share/polkit-1
/usr/share/polkit-1/actions
/usr/share/polkit-1/actions/org.freedesktop.policykit.policy
/var
/var/lib
/var/lib/polkit-1
/var/lib/polkit-1/localauthority
/var/lib/polkit-1/localauthority/10-vendor.d
/var/lib/polkit-1/localauthority/20-org.d
/var/lib/polkit-1/localauthority/30-site.d
/var/lib/polkit-1/localauthority/50-local.d
/var/lib/polkit-1/localauthority/90-mandatory.d
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/polkit-1/polkit-agent-helper-1
/usr/share/doc/polkitd/changelog.Debian.gz

dpkg-query: package 'polkitd-pkla' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
muziqaz@mintlinux:~$ 

Linux Mint 21.2

@marcosfrm
Copy link
Contributor

sudo apt install polkitd-pkla will solve it. With an active working unit, run systemd-inhibit --list to verify.

Mint 21 uses the outdated 0.105 version, while Mint 22 uses the new version with JavaScript-based rules. Our DEB package uses the older rules for broader compatibility. Therefore, on Mint 22, polkitd-pkla is required. The old policykit-1 started providing polkitd-pkla in version 0.105-32:

https://salsa.debian.org/utopia-team/polkit/-/commit/9e392db5105240817c235e74b5a3f4043fda256a

However, I'm uncertain if this change was backported to older versions, especially Ubuntu 20.04 LTS. Thus, I think I'll recommend polkitd-pkla instead of requiring it.

@muziqaz
Copy link
Contributor Author

muziqaz commented Oct 15, 2024

Hm, but if distros keeps updating the packages, we will be back to square one

@marcosfrm
Copy link
Contributor

By default, apt installs recommended packages. This should be sufficient for our needs. When the next Debian is released, they should completely remove support for the old rule format, finally catching up with other distributions, maybe 15 years late.

marcosfrm added a commit to marcosfrm/fah-client-bastet that referenced this issue Oct 15, 2024
Required to prevent sleep on Debian 12, Ubuntu 24.04 LTS, and Mint 22. Cannot be depended on as the
polkitd-pkla package is not available or provided by any other package in older versions (< 0.105-32).

Closes FoldingAtHome#296
@marcosfrm marcosfrm linked a pull request Oct 15, 2024 that will close this issue
marcosfrm added a commit to marcosfrm/fah-client-bastet that referenced this issue Oct 16, 2024
Required to prevent sleep on Debian 12, Ubuntu 24.04 LTS, and Mint 22. Cannot be depended on as the
polkitd-pkla package is not available or provided by any other package in older versions
(policykit-1 < 0.105-32).

Closes FoldingAtHome#296
marcosfrm added a commit to marcosfrm/fah-client-bastet that referenced this issue Oct 17, 2024
Due to our use of the legacy rule format for broader Debian compatibility, the policykit-1 dependency needs
to be versioned. Otherwise, newer versions' transitional package won't pull in polkitd-pkla.

Closes FoldingAtHome#296
@marcosfrm
Copy link
Contributor

Pushed a new version requiring the dependency in #297. It should be compatible with all Debian systems.

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

Successfully merging a pull request may close this issue.

2 participants