When trying to run gui-wm/sway it outputs error log with gui-libs/wlroots errors issued when calling libelogind function. Main error is "User has no sessions". I am trying to ditch X and make setuid obsolete (I have -suid everywhere) for security reasons. Reproducible: Always Steps to Reproduce: 1. On OpenRC system, compile everything with -suid 2. Install sway with elogind support 3. Run sway Actual Results: Output is in sway.log. I run gdb and the problem is as follows: get_greeter_session in wlroots calls libelogind function sd_uid_get_sessions which calls parse_env_file* functions that try to read file "/run/systemd/users/1000" but it doesn't exist so we have ENOENT and everything fails. Expected Results: I guess the file should be created after logging as user but before running sway, and then sway should happily run. Running sway: User is in input and video groups. I run sway in .profile (sourced by bash_profile) after creating XDG_RUNTIME_DIR (in this case 1000-runtime-dir) the usual way, by WLR_DRM_DEVICES=/dev/dri/card0 sway --debug --verbose 2> sway.log Hardware: I use Intel GPU (00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)), but i have also NVIDIA card, without any drivers in use (so it doesn't show up in /dev/dri/). I tried multiple combinations of versions of sway and wlroots, ~amd64 elogind, nothing works, same error. Elogind is on runlevel boot, dbus default.
Created attachment 613946 [details] Sway errors
Created attachment 613948 [details] emerge --info
Shouldn't you also add `dbus-launch --exit-with-session` to your command? I am unconvinced elogind is the first address to search for the issue.
dbus-launch --exit-with-session sway Doesn't help. Same error. I didn't know where to address that issue. Should this print 0? /* file.c */ #include <unistd.h> #include <sys/types.h> #include <elogind/sd-login.h> #include <studio.h> int main(void) { char **user_sessions = NULL; int user_session_count = sd_uid_get_sessions(getuid(), 1, &user_sessions); printf("%d\n", user_session_count); return 0; } gcc -L/lib64/elogind -Wl,-rpath=/lib64/elogind -lelogind-shared-241.4 file.c -o file
I will paste here "chain" of functions executed maybe it will be helpful. ("in <file>" means "implementation is in <file>") main (sway) | in sway/main.c V server_privileged_prepare (sway) | in sway/server.c V wlr_backend_autocreate (wlroots) | in backend/backend.c V wlr_session_create (wlroots) | in backend/sessions/sessions.c V session_logind.create (wlroots) | in backend/session/logind.c V logind_session_create (wlroots) | in backend/session/logind.c V get_display_session (wlroots) | in backend/session/logind.c V get_greeter_session (wlroots) | in backend/session/logind.c V sd_uid_get_sessions (elogind)
Somehow in my package.use was -elogind on sys-auth/pambase. I added elogind in USE in make.conf. Resolved.