Hi all, I am running the latest ~amd64. Updating systemd to 245_rc1-r1 gives the following error on running sway from console: $ sway -V 2020-02-08 07:35:23 - [sway/main.c:152] Linux janis 5.5.2 #1 SMP PREEMPT Thu Feb 6 08:10:12 GMT 2020 x86_64 Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz GenuineIntel GNU/Linux 2020-02-08 07:35:23 - [sway/main.c:168] Contents of /etc/os-release: 2020-02-08 07:35:23 - [sway/main.c:152] NAME=Gentoo 2020-02-08 07:35:23 - [sway/main.c:152] ID=gentoo 2020-02-08 07:35:23 - [sway/main.c:152] PRETTY_NAME="Gentoo/Linux" 2020-02-08 07:35:23 - [sway/main.c:152] ANSI_COLOR="1;32" 2020-02-08 07:35:23 - [sway/main.c:152] HOME_URL="https://www.gentoo.org/" 2020-02-08 07:35:23 - [sway/main.c:152] SUPPORT_URL="https://www.gentoo.org/support/" 2020-02-08 07:35:23 - [sway/main.c:152] BUG_REPORT_URL="https://bugs.gentoo.org/" 2020-02-08 07:35:23 - [sway/main.c:168] Contents of /etc/gentoo-release: 2020-02-08 07:35:23 - [sway/main.c:152] Gentoo Base System release 2.6 2020-02-08 07:35:23 - [sway/main.c:140] LD_LIBRARY_PATH=(null) 2020-02-08 07:35:23 - [sway/main.c:140] LD_PRELOAD=(null) 2020-02-08 07:35:23 - [sway/main.c:140] PATH=/usr/lib/llvm/9/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin 2020-02-08 07:35:23 - [sway/main.c:140] SWAYSOCK=(null) 2020-02-08 07:35:23 - [backend/session/logind.c:217] Failed to activate session: Permission denied 2020-02-08 07:35:23 - [backend/session/direct-ipc.c:35] Do not have CAP_SYS_ADMIN; cannot become DRM master 2020-02-08 07:35:23 - [backend/session/session.c:96] Failed to load session backend 2020-02-08 07:35:23 - [backend/backend.c:286] Failed to start a DRM session 2020-02-08 07:35:23 - [backend/noop/backend.c:51] Creating noop backend 2020-02-08 07:35:23 - [sway/server.c:47] Unable to create backend Downgrading to systemd-244 does not present this error. Thanks Reproducible: Always Steps to Reproduce: 1. emerge =systemd-245_rc1-r1 2. sway 3. Actual Results: 2020-02-08 07:35:23 - [backend/session/logind.c:217] Failed to activate session: Permission denied 2020-02-08 07:35:23 - [backend/session/direct-ipc.c:35] Do not have CAP_SYS_ADMIN; cannot become DRM master 2020-02-08 07:35:23 - [backend/session/session.c:96] Failed to load session backend 2020-02-08 07:35:23 - [backend/backend.c:286] Failed to start a DRM session 2020-02-08 07:35:23 - [backend/noop/backend.c:51] Creating noop backend 2020-02-08 07:35:23 - [sway/server.c:47] Unable to create backend Expected Results: sway session
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).