Summary: | sys-auth/polkit-124-r1: breaks suspend to ram and restart in KDE Plasma 5.27.10 (works with sys-auth/polkit-123) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Uros <infinity80> |
Component: | Current packages | Assignee: | Freedesktop bugs <freedesktop-bugs> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | atoth, benjamin.blanz, gentoo, gentoobugzilla, holger, infinity80, kde, sam, sven.eden |
Priority: | Normal | Keywords: | PMASKED, PullRequest |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=934314 https://github.com/gentoo/gentoo/pull/38332 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 938921 | ||
Bug Blocks: | |||
Attachments: | polkit-124-hacky-elogind-no-pidfd.patch |
Description
Uros
2024-02-02 09:03:27 UTC
diff: https://github.com/polkit-org/polkit/compare/123...124. It's pretty small. Please include emerge --info sys-auth/polkit. Do you mean Plasma 5, Plasma 6, ... ? I'm using plasma 5 - 5.27.10 Emerge info: Portage 3.0.61 (python 3.11.7-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-13, glibc-2.38-r9, 5.10.206-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-5.10.206-gentoo-x86_64-AMD_Ryzen_5_PRO_4650G_with_Radeon_Graphics-with-glibc2.38 KiB Mem: 32686928 total, 27395180 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Sat, 27 Jan 2024 14:45:01 +0000 Head commit of repository gentoo: ddd244aea870dd7ef29b17f66ae351497f367b75 sh bash 5.2_p26 ld GNU ld (Gentoo 2.41 p5) 2.41.0 app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.2_p26::gentoo dev-build/autoconf: 2.72-r1::gentoo dev-build/automake: 1.16.5-r1::gentoo dev-build/cmake: 3.28.1-r1::gentoo dev-build/libtool: 2.4.7-r2::gentoo dev-build/make: 4.4.1-r1::gentoo dev-build/meson: 1.3.1-r1::gentoo dev-lang/perl: 5.38.2-r1::gentoo dev-lang/python: 3.11.7::gentoo sys-apps/baselayout: 2.14-r1::gentoo sys-apps/openrc: 0.53::gentoo sys-apps/sandbox: 2.38::gentoo sys-devel/binutils: 2.41-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/gcc: 13.2.1_p20231216::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/llvm: 14.0.4::gentoo sys-kernel/linux-headers: 6.7::gentoo (virtual/os-headers) sys-libs/glibc: 2.38-r9::gentoo Repositories: gentoo location: /usr/portage/tree sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 volatile: True sync-rsync-verify-metamanifest: no sync-rsync-extra-opts: --info=progress2,name0,del0 sync-rsync-verify-max-age: 3 sync-rsync-verify-jobs: 1 local location: /usr/local/portage masters: gentoo priority: 0 volatile: True ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=core2 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=core2 -O2 -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--quiet-build=y --autounmask-keep-masks" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles getbinpkg ipc-sandbox merge-sync multilib-strict network-sandbox news nodoc noinfo noman parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="POSIX" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" LINGUAS="en" MAKEOPTS="-j12" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="--info=progress2,name0,del0" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="X a52 aac acl acpi alsa amd64 bash-completion branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr elogind exif flac fortran gdbm gif gpm gui iconv icu idn ipv6 jpeg kde lcms libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl nss ogg opengl openmp pam pango pcre pdf pipewire plasma png policykit ppds qml readline screencast seccomp sound split-usr ssl startup-notification svg system-sqlite test-rust tiff truetype udev udisks unicode upower usb userlocales vaapi vdpau vorbis vulkan widgets wxwidgets x264 xattr xcb xft xinerama xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 mmx mmxext sse sse2 sse3 ssse3 sse4_1 sse4_2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS ================================================================= Package Settings ================================================================= sys-auth/polkit-124-r1::gentoo was built with the following: USE="daemon duktape introspection kde pam -examples -gtk (-selinux) -systemd -test" ABI_X86="(64)" FEATURES="news fixlafiles strict network-sandbox sfperms unknown-features-warn usersync preserve-libs protect-owned multilib-strict noman parallel-fetch xattr unmerge-orphans noinfo qa-unresolved-soname-deps usersandbox assume-digests ipc-sandbox nodoc config-protect-if-modified pid-sandbox unmerge-logs distlocks userpriv merge-sync binpkg-logs pkgdir-index-trusted getbinpkg ebuild-locks buildpkg-live binpkg-dostrip sandbox binpkg-docompress" I've never set up suspend-to-ram but restart works fine on my Plasma-5 systems fwiw. Can you be a bit more specific than 'doesn't work'? Clicking on "sleep" or "restart" buttons/icons in "lock/logout widget" or "shutdown menu" do nothing. There are no related error logs (that I could find) in /var/log/everything/current or .local/share/sddm/xorg-session.log With sys-auth/polkit-123 the following entries are added to /var/log/everything/current when triggering "sleep": Feb 04 18:03:21 [kernel] elogind-daemon[2892]: Entering sleep state 'suspend'... Feb 04 18:03:21 [kernel] PM: suspend entry (deep) See also 934314. The problem occurs also with XFCE4 power manager. Reverting polkit to version 123 makes the power off, suspend and restart buttons to work again (there buttons are grayed with version 124). Please upgrade to sys-auth/elogind-252.9-r2 at the same time with sys-auth/polkit-124-r1 and try again. Please see my instructions/request for help at https://bugs.gentoo.org/934314#c12. Rebuilt sys-auth/elogind-252.9-r2 and upgraded sys-auth/polkit to 124-r1 and 125. Issue is still present in both versions. When following instructions in https://bugs.gentoo.org/934314#c12, it fails on step #2 with the following error: Run-time dependency systemd found: NO (tried pkgconfig and cmake) Message: systemd required but not found, please provide a valid systemd user unit dir or disable it meson.build:211:16: ERROR: Dependency "systemd" not found, tried pkgconfig and cmake I'm running sys-apps/openrc (0.54.2) as mentioned in first comment. ok, my patch hack wasn't good enough then. Later I (or maybe asturm if he gets time today) will just sed the bits out given we know the only people testing it are on openrc The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e221ed6c0979b6297d8ec40b1e41552d60f85ac commit 8e221ed6c0979b6297d8ec40b1e41552d60f85ac Author: Sam James <sam@gentoo.org> AuthorDate: 2024-09-02 02:25:41 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-09-02 02:25:41 +0000 sys-auth/polkit: improve 9999-r1 hacks We want to work with elogind for all commits we test. We don't care about this test ebuild working with systemd, so hacky sed it is. Bug: https://bugs.gentoo.org/923614 Bug: https://bugs.gentoo.org/934314 Signed-off-by: Sam James <sam@gentoo.org> sys-auth/polkit/polkit-9999-r1.ebuild | 1 + 1 file changed, 1 insertion(+) Please try again. If you have issues, please give the full log. Built and tested versions up to commit 7f0d792323cdca70b3d581cc9ed54df3d844a637 (https://github.com/polkit-org/polkit/commit/7f0d792323cdca70b3d581cc9ed54df3d844a637). This one breaks things for me. Thank you for the testing! I will take a bit of time to analyse. elogind-255.5 has a bunch of pidfd changes, so filed bug 938921 for that, but I'll look more later to see if I can at least make a quick workaround to try for stable. Created attachment 901896 [details, diff]
polkit-124-hacky-elogind-no-pidfd.patch
Uros, can you try two things:
1) elogind-255.5 which was just committed? (I hope it should work);
2) applying this attached patch to bad polkit via /etc/portage/patches (I prepared it against 124-r1) as a hacky workaround for now
Updated sys-auth/elogind to 255.5 and applied provided polkit-124-hacky-elogind-no-pidfd.patch to sys-auth/polkit-124-r1. Issue is still present. Downgraded sys-auth/polkit to 123 and it works with sys-auth/elogind-255.5 as expected. (In reply to Uros from comment #17) > Updated sys-auth/elogind to 255.5 and applied provided > polkit-124-hacky-elogind-no-pidfd.patch to sys-auth/polkit-124-r1. > > Issue is still present. > > Downgraded sys-auth/polkit to 123 and it works with sys-auth/elogind-255.5 > as expected. How about elogind-255.5 + unpatched polkit-125? I'm surprised by this but will look more later.. elogind-255.5 + unpatched polkit-125 doesn't work either. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e13b2238a22208eab1a24fe839fd61b81b3acb2 commit 8e13b2238a22208eab1a24fe839fd61b81b3acb2 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-11-10 13:09:56 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-11-10 13:09:56 +0000 profiles: mask >=sys-auth/polkit-124 on non-systemd profiles >=polkit-124 breaks suspend on elogind systems and I haven't been able to get to the bottom of it, so mask for now. Bug: https://github.com/polkit-org/polkit/issues/451 Bug: https://bugs.gentoo.org/923614 Bug: https://bugs.gentoo.org/934314 Signed-off-by: Sam James <sam@gentoo.org> profiles/base/package.mask | 5 +++++ profiles/targets/systemd/package.mask | 8 ++++++++ 2 files changed, 13 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2f9f5170ef6f65713d7c9e86501a8388d9d8d6f commit b2f9f5170ef6f65713d7c9e86501a8388d9d8d6f Author: Sam James <sam@gentoo.org> AuthorDate: 2024-11-10 13:06:43 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-11-10 13:06:58 +0000 Revert "sys-auth/polkit: drop 123" This reverts commit a8d1fdb294af26b3ba1797886ab9f1e49867ef73. Needed for elogind. Bug: https://bugs.gentoo.org/923614 Bug: https://bugs.gentoo.org/934314 Signed-off-by: Sam James <sam@gentoo.org> sys-auth/polkit/Manifest | 1 + sys-auth/polkit/files/polkit-123-mozjs-JIT.patch | 36 +++++ .../files/polkit-123-pkexec-uninitialized.patch | 35 +++++ sys-auth/polkit/polkit-123.ebuild | 162 +++++++++++++++++++++ 4 files changed, 234 insertions(+) Just some extra information as I have had a similar, but working, system for a long time. Came here because I wondered why my installed polkit was suddenly masked. I have been able to use restart and sleep with no problem for a long time. I am also on openrc and was on plasma 5. I am on a 95% stable packages system. Nothing out of stable should be related to polkit I believe. So this problem is not just about openrc/plasma 5/polkit but must somehow depend on some settings or other packages. The only thing I have added to polkit rules are: cat /etc/polkit-1/rules.d/90-corectrl.rules polkit.addRule(function(action, subject) { if ((action.id == "org.corectrl.helper.init" || action.id == "org.corectrl.helperkiller.init") && subject.local == true && subject.active == true && subject.isInGroup("sax")) { return polkit.Result.YES; } }); Some relevant genlop snippets for package versions used in the timeframe since I installed polkit-124 (I have cut out reinstall of same versions): genlop polkit: Thu May 30 11:27:51 2024 >>> sys-auth/polkit-124-r1 Sun Nov 10 15:20:12 2024 >>> sys-auth/polkit-125-r1 genlop elogind: Sun Mar 24 02:30:03 2024 >>> sys-auth/elogind-246.10-r3 Thu Jun 13 11:08:09 2024 >>> sys-auth/elogind-246.10-r4 Sun Sep 22 13:28:05 2024 >>> sys-auth/elogind-252.9-r2 genlop plasma-workspace: Mon Mar 25 07:21:38 2024 >>> kde-plasma/plasma-workspace-5.27.11 Fri Jun 7 12:55:04 2024 >>> kde-plasma/plasma-workspace-5.27.11.1-r1 Sun Sep 1 22:18:22 2024 >>> kde-plasma/plasma-workspace-6.1.4-r1 Sun Sep 22 03:16:49 2024 >>> kde-plasma/plasma-workspace-6.1.5-r2 Tue Oct 22 11:21:05 2024 >>> kde-plasma/plasma-workspace-6.1.5-r3 genlop openrc: Tue Apr 2 10:48:40 2024 >>> sys-apps/openrc-0.54 Thu Jun 27 11:41:33 2024 >>> sys-apps/openrc-0.54.1 Sat Jun 29 11:16:22 2024 >>> sys-apps/openrc-0.54.2 I should note that I have had problems with getting out of sleep lately, but I am 99% sure that is unrelated. I upgraded my hardware some weeks ago and upgraded kernel and mesa to have that work properly, so that is probably where my sleep issue comes from. It may depend on whether the kernel is new enough to support pidfd and some config options related to it are enabled. (In reply to Sam James from comment #22) > It may depend on whether the kernel is new enough to support pidfd and some > config options related to it are enabled. I have been on gentoo-sources 6.6 series in the relevant time frame, until recently where I upgraded because of hardware upgrade. I still have configs for 6.6.38, 47 and 52. So if you want me to check for some options or get a copy, let me know. (In reply to Sam James from comment #22) > It may depend on whether the kernel is new enough to support pidfd and some > config options related to it are enabled. I'm still running 5.10.226. It might be possible, that I don't have needed config options enabled. Any idea how to check and/or enable it? (In reply to Uros from comment #24) > (In reply to Sam James from comment #22) > > It may depend on whether the kernel is new enough to support pidfd and some > > config options related to it are enabled. > > I'm still running 5.10.226. It might be possible, that I don't have needed > config options enabled. > > Any idea how to check and/or enable it? Best I found so far is the commit that enabled them unconditionally: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9d9539db8638cfe053fcd1f441746f0e2c8c2d32 (In reply to Holger Hoffstätte from comment #25) > (In reply to Uros from comment #24) > > (In reply to Sam James from comment #22) > > > It may depend on whether the kernel is new enough to support pidfd and some > > > config options related to it are enabled. > > > > I'm still running 5.10.226. It might be possible, that I don't have needed > > config options enabled. > > > > Any idea how to check and/or enable it? > > Best I found so far is the commit that enabled them unconditionally: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/ > ?id=9d9539db8638cfe053fcd1f441746f0e2c8c2d32 ..and this should be in >=6.9 Checking polkit commit from #13, that breaks my system, "pidfd_open" kernel function referred in that changelog is present in 5.10 (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/pid.c?h=v5.10#n584) and not related to any kernel configuration option, that I could find. The other thing added in that polkit commit was "sd_pidfd_get_session" that is present only in elogind v255 branch (https://github.com/elogind/elogind/blob/v255-stable/src/libelogind/sd-login/sd-login.c#L155). Went ahead and upgraded to sys-auth/polkit-125-r1 and sys-auth/elogind-255.5. Afterwards I've upgraded kernel to sys-kernel/gentoo-sources-6.6.60 and sys-kernel/gentoo-sources-6.11.7. Issue was present in all (5.10, 6.6, 6.11) versions. It's probably not kernel "pidfd" related. (In reply to Uros from comment #27) > Afterwards I've upgraded kernel to sys-kernel/gentoo-sources-6.6.60 and > sys-kernel/gentoo-sources-6.11.7. Issue was present in all (5.10, 6.6, 6.11) > versions. It's probably not kernel "pidfd" related. Interesting! Try changing your elogind config as discussed in https://bugs.gentoo.org/939042 and especially comment #2 (reverse order of "s2idle deep" to "deep s2idle"). Changing SuspendMode in /etc/elogind/sleep.conf.d/10-elogind.conf (sys-auth/elogind-255.5) solves sleep issue, but only for x11-misc/sddm, suspend and restart in plasma 5 are still not working. I'll stay on sys-auth/polkit-123 and sys-auth/elogind-252 until I move to plasma 6. If issue persists with plasma 6, I'll open new issue. Since kde-plasma/plasma-workspace-5 is not in tree anymore, I guess this can be closed. |