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
Cannot start gnome wayland session with mutter/elogind #61
Comments
Yes. The Gentoo Forum has an extensive thread about running Gnome Without Systemd. Please refer to that, as many Gnome packages have to be patched to accept elogind as a systemd-login drop-in replacement. |
I'd seen that thanks, but the link is mostly speaking of earlier versions of gnome, whereas with gnome-3.28.x several of the packages (eg mutter) compile against elogind directly. In any case, if it were an issue of elements of gnome not playing nicely with elogind, I'd probably get a different error message. As said, I'm looking for advice on how to start elogind so it gives a seat to a given user and thus allows for the creation of a wayland display - I've done plenty of googling, but have not come up with anything yet. |
This patch might help, but I don't use gnome myself. |
@juanitotc : The build system installs Further, the link I gave you is a whole thread, and main development actually is about Gnome 3.28. Several users have reported, that they could fully install and use Gnome 3.28 with dantrell's help. The only other thing that comes to my mind is pam. Without pam, there is no way the system could tell elogind who logs in where, so loginctl will always yield an empty result. |
I read through the entire gentoo thread - from page 26 on the majority of the issues are of various gnome components failing to build, whereas I managed to build gnome-3.28.x without problems and against elogind where it was an option. I know my compiled gnome-3.28.x works because an X11 session runs from startx. I know wayland works because I can start weston like this: $ XDG_SESSION_TYPE=wayland XDG_RUNTIME_DIR=/run/user/1001 weston-launch ..and it reports WAYLAND_DISPLAY=wayland-0 However, whether I start elogind manually or let gnome-session start it, this fails: $ XDG_SESSION_TYPE=wayland XDG_RUNTIME_DIR=/run/user/1001 gnome-session ..with the error mentioned in comment 1 |
Please log into any tty and look what "loginctl" shows. If it works (elogind is running) but no seats are listed, than I ask you to check that PAM is configured properly. You should, for instance, have a /etc/pam.d/system-auth file. |
Note that on tinycorelinux by default there is no login or password required and, as much as possible, apps such as consolekit, elogind, linux-pam are only used when other apps require them in order to build. I get the following: SESSION UID USER SEAT TTY 0 sessions listed. $ cat /usr/local/etc/pam.d/system-auth account required pam_unix.so password sufficient pam_unix.so use_authtok nullok session required pam_limits.so |
I guess this confirm things: $ gnome-shell --wayland (gnome-shell:22377): mutter WARNING: Can't initialize KMS backend: Could not get session ID: No such file or directory ..but how can I generate a session ID? |
Do you have these?
|
Yes, I do have those directories |
Sorry that I did not spot this sooner. Please add the line
to your Without that no login is reported to elogind and thus no session created. no initial session, no seat. |
thanks - unfortunately that doesn't change anything :( As mentioned, I am not actually logging in to anything - is there a way to simulate a login or disable login, but still create a session? |
If I use a gnome X11 session, gnome-session starts elogind, but doesn't seem to seem to use the session ID because things work. Perhaps with a gnome wayland session, elogind needs to be started in a particular way using dbus prior to starting gnome-session. I've tried the following, but it still doesn't work: $ sudo dbus-launch /usr/local/lib/elogind/elogind --daemon |
You don't need dbus-launch. You need a dbus system daemon. If everything works right, then any login will do. Try to log into any tty. CTRL-Alt-F2 gets you on one. If loginctl in there shows a seat and session, then everything is in order. Otherwise your PAM installation does not work or the elogind daemon is not running. The latter can be checked with ps. |
What is the output of:
If it is none, then please try Further, your two commands would have put elogind and gnome session into two separate dbus sessions. You only need to run 'dbus-launch' once and have a session dbus. However, having to do this isn't a good sign at all. Maybe this thread can help: Topic: dbus not starting?
And Juanito replied:
Does that help? |
I made some progress in discovering that polkit-0.114 needed a patch for elogind and also patched gnome-session to make sure it used elogind. Now, when I try to start an X11 session with startx I get: gnome-session-binary[4746]: WARNING: Could not get session id for session. Check that logind is properly installed and pam_systemd is getting used at login. ..or if I modify things so that gnome-session is called with dbus-run-session, I get: dbus-daemon[6830]: [session uid=1001 pid=6830] Activating service name='org.a11y.Bus' requested by ':1.2' (uid=1001 pid=6834 comm="/usr/local/lib/gnome-session/gnome-session-check-a") As compared to previous attempts, gnome-session no longer starts elogind itself and I need to start it prior to "startx" The problem seems to remain that, on a system that has no login and no passwords set, how do I start a session such that elogind picks up the session ID Note that in both the above cases, the gnome X11 desktop starts, but a lot of functionality has permission errors. |
I forgot to mention, I get: $ echo $DBUS_SESSION_BUS_ADDRESS |
I think that this is the reason. But I have no real idea how TinyCore actually works. I have read a bit on their web pages, but that is not enough to create much understanding. Have you tried the TinyCore forums yet? I fear that I can not be of much more help here. |
I'm not so sure that the problem is tinycore per se, but more that I do not understand how elogind is meant to be used - I don't think elogind can give gnome-session a session id because it does not have one under /run/systemd/sessions Is elogind meant to be started before gnome-session is launched (if so, how?) or be started by gnome-session? Are the files created by elogind under /run/systemd meant to have their permissions adjusted for the user? Is dbus meant to be configured differently when used with elogind? |
It doesn't matter if everything is in the right place. The first process that requests
No. The directory structure is created by the elogind daemon, and all files there are owned by it. Which basically means root:root.
No. elogind is a drop-in replacement for systemd-login. That's all there is to it. |
Hmm - everything seems to be in place, but still no go. Since tinycorelinux is not systemd I cannot check "everything that works with systemd-login works with elogind" After starting elogind it only shows a seat0, but no user nor session. I can get elogind to show a user using "loginctl enable-linger $USER" - is there any test I can use to try and see why it does not show a session or force it to show a session? |
Do you have a cgroup at |
I believe so: $ sudo /usr/local/lib/elogind/elogind --daemon $ ls /sys/fs/cgroup/elogind |
ok, that looks fine. It was just an idea as I had some issues with a missing cgroup (without error message) in other circumstances. |
I found a small c program using getsid() to find the session ID and tried to activate the session with elogind, but got this: $ sudo loginctl activate 6416 Is getsid() the session id elogind is looking for? Can I manually find the session ID and pass it to elogind? Note - I also used strace on elogind, but did not see any obvious errors. |
You can configure elogind with
That would be the session ID of the program. This has nothing to do with users. If no cgroups manager is found, elogind tries to be its own tiny manager. (Works so far on VOID Linux) What is the output of |
I get the following: $ cat /proc/self/cgroup ..and: $ ps -eo pid,user,cmd,args,sid --sort user i.e. there seems to be a couple of SID,but I cannot active either with "sudo loginctl activate" |
No. The SID from ps is the process session ID. This has nothing to do with users. It is only a number for sessions groups of processes run in. See: https://www.win.tue.nl/~aeb/linux/lk/lk-10.html However, What init system is used? Can it be used as a cgroup controller? Could you try to configure elogind not only with the debugging above, but also with |
Recompiling elogind with "-Ddebug=elogind --buildtype=debug -Ddefault-hierarchy=legacy", I get the attached log when starting elogind from a console prompt and then starting gnome-session via startx Note that polkitd runs when started manually as root |
You could check if
In another setup I created elogind cgroup before starting elogind (without
|
The log says:
That is a hybrid setup. I think we have found an issue with either the build system or elogind playing cgroup controller. That is definitely something I have to investigate.
That one is mounted asa cgroup file system. So basically everything is in order.
Alright, the seat is there.
Okay, that is very bad! Please investigate. For everything elogind asks, dbus tries to spawn org.freedesktop.PolicyKit1 and fails. |
btw, to answer an earlier question, tinycorelinux uses busybox init |
Ref: "For everything elogind asks, dbus tries to spawn org.freedesktop.PolicyKit1 and fails." org.freedesktop.PolicyKit1 (/usr/local/lib/polkit-1/polkitd) will start as root and then successfully changes to the default user. This is where I'm confused by elogind - /usr/local/etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf allows the default user to own org.freedesktop.PolicyKit1 - is this config used by elogind or are separate polkit rules/actions required for elogin to spawn org.freedesktop.PolicyKit1 as root? If separate polkit rules/actions are required, I'd be grateful if you could point me to an example $ sudo /usr/local/lib/polkit-1/polkitd |
Aaaargh - the permissions on dbus-daemon-launch-helper were incorrect Now if I:
I get: ..but there is still no session ID ..and the startup of the gnome desktop and operation of gnome-control-center are much slower than before. |
As I said. PAM must be used. And please do not use
And is BusyBox built with PAM support? You must have any means to log in a user through pam. Without that this will not work. A login manager like SDDM or whatever gnome uses these days should be enough. |
I'd really like to avoid using any login manager at all - is there no way to do this by working with pam directly? |
I found that |
No, the idea of tinycorelinux is to have the smallest possible bootable system and add anything that is needed afterwards.
Switching to root cause elogind to write several files to /run/systemd/inaccessible, but switching back to the default user does not trigger a login with elogind.
gnome will not start (gjs gives a critical error) without gdm present, but I have never managed to make gdm work, hence I'm reluctant to try another dm (sddm). |
Ah-ha - "su" from busybox was being used. If I use "su" from shadow and "su $USER" where $USER is the current default user, things work.
..and gnome runs in both x11 and wayland sessions :) Thanks for the help and suggestions |
Wow! Congratulations on finally working this out! Maybe, if you want, you could describe your findings to the TinyCoreLinux people? That could help others who try what you did in the future. |
Already done, see the last post here: http://forum.tinycorelinux.net/index.php/topic,16875.msg137479.html#msg137479 |
👍 |
Forgive me bothering You with thing a bit unrelated to this ticket...but i'm really desperate (and frustrated) - so looking also here for help.... I'm developing linux based appliance and i lost days trying to find solution for: auto-start app. using weston compositor. As I see:
Is it possible to help me to solve problem of getting auto-starting app. which uses weston compositor? Status: i have already all working when i:
Issue is with automating this to get auto-starting at appliance boot... |
This would then be a matter of the init system. What are you using? SysVInit directly, runnit, openrc, something else? There I'd start looking. Personally I do not know enough about weston to tell you what the requirements are for your app to be auto-startable. However, here someone seems to have had a similar problem/requirement: Maybe you'll get some inspiration there. |
I'm trying to get gnome-3.28 to work with wayland using mutter/elogind and the minium use of consolekit, polkit, linux-pam and friends.
gnome-3.28 works with an X11 display
weston works with a wayland display
On this distro (tinycorelinux) no daemons are started by default, but gnome-3.28/X11 display works after manually starting the dbus daemon - I presume gnome-session auto starts everything else that it needs and indeed elogind is running in the X11 session.
After modifying the last line of /usr/local/bin/gnome-session from:
XDG_RUNTIME_DIR=/run/user/$(id -u) XDG_SESSION_TYPE=X11 exec /usr/local/lib/gnome-session/gnome-session-binary "$@"
to:
XDG_RUNTIME_DIR=/run/user/$(id -u) XDG_SESSION_TYPE=wayland exec /usr/local/lib/gnome-session/gnome-session-binary "$@"
..I would expect a wayland session to start, but I get:
(gnome-shell:2746): mutter: Failed to create backend: Unable to open display, DISPLAY not set
gnome-session-binary[2722]: WARNING: App 'org.gnome.Shell.desktop' exited with code 1
In the X11 session I see:
$ loginctl
...
SESSION UID USER SEAT TTY
0 sessions listed.
..so I presume the problem is there - if there were a seat 0, then the display wayland-0 would exist.
Is there an easy way to make this work with elogind?
The text was updated successfully, but these errors were encountered: