Summary: | gui-wm/sway with sys-apps/systemd-245_rc1-r1 : backend/session/direct-ipc.c:35: Do not have CAP_SYS_ADMIN; cannot become DRM master | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Vasco Gervasi <yellowhat46> |
Component: | Current packages | Assignee: | Aaron Bauman (RETIRED) <bman> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | bearcatsandor, prometheanfire, speedjack95, yellowhat46 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
emerge --info
export from tty |
Description
Vasco Gervasi
2020-02-08 07:40:06 UTC
Created attachment 612632 [details]
emerge --info
I'm not seeing any reason 245 should cause problems (and 244 works for me). https://github.com/systemd/systemd/blob/master/NEWS is sway emerged with the systemd use flag set? (emerge --info sway) Yes it is: [ebuild R ] gui-wm/sway-1.4::gentoo USE="man swaybar swaybg swaylock swaymsg swaynag systemd -X -elogind -fish-completion -swayidle -tray -wallpapers -zsh-completion" 0 KiB Same error with systemd-245_rc1-r2 Same error with systemd-245_rc2 Same error with systemd-245 Maybe related to this: https://github.com/systemd/systemd/commit/4acf0cfd2f92edb94ad48d04f1ce6c9ab4e19d55 I also ran into this when upgrading to systemd-245. After upgrading through portage, I ran `systemd-run -S` (use systemd-run to get a root shell) as root, which crashed sway and sddm and both wouldn't start again. Two workarounds: 1) adding CAP_SYS_ADMIN to /usr/bin/sway setcap cap_sys_admin+ep /usr/bin/sway 2) adding a polkit rule to allow passwordless access to org.freedesktop.login1.chvt: polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.login1.chvt") { return polkit.Result.YES; } }); Also, downgrading to systemd-244 also 'resolves' the issue. Upstream a patch has been merged (https://github.com/systemd/systemd/commit/19bb87fbfac8df67c0c8ff4714382a88733c61a2), I have tried to patch systemd-245 but still same error. Thanks related to this patch? (test the systemd patch please) https://github.com/systemd/systemd/pull/15111 and nevermind :| have you tried with the https://github.com/systemd/systemd/commit/4acf0cfd2f92edb94ad48d04f1ce6c9ab4e19d55 patch though (I see that you tried with the oneline patch) Seems that https://github.com/systemd/systemd/commit/4acf0cfd2f92edb94ad48d04f1ce6c9ab4e19d55 is already part of 245. ya, it looks like the error may be something else I experienced this issue as well, but since upgrading to 245 in a new installation, I don't have this problem anymore. However, I did manage to fix this by enabling early kernel modesetting. Using `dracut`: ``` $ cat /etc/dracut.conf.d/10-drm.conf add_dracutmodules+="drm" ``` Hope this proves helpful in some way. (In reply to Piero La Terza from comment #15) > I experienced this issue as well, but since upgrading to 245 in a new > installation, I don't have this problem anymore. > > However, I did manage to fix this by enabling early kernel modesetting. > > Using `dracut`: > > ``` > $ cat /etc/dracut.conf.d/10-drm.conf > add_dracutmodules+="drm" > ``` > > Hope this proves helpful in some way. PS. if you do this, you'll also have to regenerate your initramfs. drm is correctly loaded: ``` $ dmesg | grep drm [ 0.497579] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [ 0.497581] [drm] Driver supports precise vblank timestamp query. [ 0.518727] [drm] Initialized i915 1.6.0 20200114 for 0000:00:02.0 on minor 0 [ 0.747427] fbcon: i915drmfb (fb0) is primary device [ 2.230944] i915 0000:00:02.0: fb0: i915drmfb frame buffer device ``` Am I missing something? Also I have tried to run: ``` $ setcap cap_sys_admin+ep /usr/bin/sway ``` But I got this errors: ``` 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event2: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event3: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event4: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event0: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event1: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event11: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event12: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event13: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event14: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event15: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event16: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event17: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event18: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event19: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event23: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event24: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event25: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event26: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event27: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event28: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event29: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event30: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event31: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event256: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event8: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event9: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event10: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event6: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event7: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event5: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event20: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event21: Permission denied 2020-04-11 13:59:21 - [backend/session/direct.c:48] Failed to open /dev/input/event22: Permission denied 2020-04-11 13:59:21 - [backend/libinput/backend.c:84] libinput initialization failed, no input devices 2020-04-11 13:59:21 - [backend/libinput/backend.c:85] Set WLR_LIBINPUT_NO_DEVICES=1 to suppress this check 2020-04-11 13:59:21 - [backend/multi/backend.c:32] Failed to initialize backend. 2020-04-11 13:59:21 - [sway/server.c:199] Failed to start backend ``` Any ideas? Thanks Seems that: sudo chmod a+s /usr/bin/sway did the trick. I think will be very helpful if the sway ebuild is modified to run this command if sway is compiled with `-elogind` use flag? pkg_preinst() { if ! use systemd && ! use elogind; then fowners root:0 /usr/bin/sway fperms 4511 /usr/bin/sway fi } pkg_postinst() { if ! use systemd && ! use elogind; then elog "" elog "If you use ConsoleKit2, remember to launch sway using:" elog "exec ck-launch-session sway" elog "" elog "If your system does not set the XDG_RUNTIME_DIR environment" elog "variable, you must set it manually to run Sway. See wiki" elog "for details: https://wiki.gentoo.org/wiki/Sway" fi } (In reply to Matthew Thode ( prometheanfire ) from comment #20) > pkg_preinst() { > if ! use systemd && ! use elogind; then > fowners root:0 /usr/bin/sway > fperms 4511 /usr/bin/sway > fi > } > > pkg_postinst() { > if ! use systemd && ! use elogind; then > elog "" > elog "If you use ConsoleKit2, remember to launch sway using:" > elog "exec ck-launch-session sway" > elog "" > elog "If your system does not set the XDG_RUNTIME_DIR > environment" > elog "variable, you must set it manually to run Sway. See > wiki" > elog "for details: https://wiki.gentoo.org/wiki/Sway" > fi > } I think that it should check only for `elogind`. I have the `systemd` use flag enabled but not the `elogind` one. Thanks for the code it's that second part that I want to verify can you run 'export' as your user to show your env-vars and attach it? can you run 'exec ck-launch-session sway' and see if that works? Created attachment 644184 [details]
export from tty
I am launching sway from tty. I do not have "ck-launch-session" installed. Thanks ok, so this might be a missing runtime dep if not using systemd or elogind. To test this, do you mind installing sys-auth/consolekit and running the ck-launch-session command? I have installed consolekit and "ck-launch-session sway" seems to work. Thanks But I have just read that consolekit has been deprecated. (In reply to Matthew Thode ( prometheanfire ) from comment #25) > ok, so this might be a missing runtime dep if not using systemd or elogind. > > To test this, do you mind installing sys-auth/consolekit and running the > ck-launch-session command? (coming from https://bugs.gentoo.org/show_bug.cgi?id=727840 ) How is this "not systemd or elogind", since Vasco Gervasi is using systemd? And setuid root has been reported as working in #comment19, which is what people without both will have. I agree, better not to have the `consolekit` dependency and run the setuid command. The setuid is well documented on the README upstream (https://github.com/swaywm/sway/blob/master/README.md). |