Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Shutdown and Restart buttons not working on GNOME 3.38 (Read 1501 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Shutdown and Restart buttons not working on GNOME 3.38

With the update to GNOME 3.38, the buttons of gnome-shell to shutdown or restart stopped working. They used to work perfectly.
I am using GDM with gdm-runit, and I have the service enabled along with dbus and elogind, and gnome-shell.
Any idea why this could be happening? Thanks in advance!

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #1
This is something that is currently being talked about and trying to find a solution for it.

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #2
This is something that is currently being talked about and trying to find a solution for it.
I see, thanks for the insight!
As an update, I've come to notice that when one of the said restart or poweroff buttons is pressed, some apps of mine start not launching with
Code: [Select]
ICE default IO error handler doing an exit(), pid = ..., errno = 0
errors, and deleting
Code: [Select]
.ICEAuthority
in the home directory serves as a fix, that is until the restart or poweroff buttons are pressed again, when the issue reproduces. Maybe this issues and the buttons malfunctioning can have a root cause?

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #3
We could possibly just delete that file on shutdown in the init scripts as a workaround. Nice find.

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #4
We could possibly just delete that file on shutdown in the init scripts as a workaround. Nice find.
That is if you can reproduce, I've checked it on a friend's system and it doesnt seem to work, while the errors after pressing the button still have to do with ICE, deleting the file doesnt fix it.
I will keep digging on it, but it seems that .ICEAuthority is not necessarily what's wrong

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #5
This is all the digging I've done so far:
The exit operations on GNOME3 are carried out by
Code: [Select]
gnome-session-quit
This command when called with `--restart` or `--power-off` loops forever, eventually timing out, this is what makes GNOME not able to reboot or shutdown.
Doing some GDB and setting a breakpoint on
Code: [Select]
poll
which was the looping part I've come to the conclusion the issue is a
Code: [Select]
g_bus_get_sync
call, if we check in the repository of gnome-session all the calls to this function happen to be one of
Code: [Select]
g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
If I have to guess, I would say its https://gitlab.gnome.org/GNOME/gnome-session/-/blob/master/tools/gnome-session-quit.c#L70
I do not know why such call would fail as I am not familiar with GIO.

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #6
Probably, the permissions of commands execution (polkit case?), are to be blamed, because the above code is common to Arch, where such an issue has not been reported yet.

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #7
Thanks, I figured out what the issue is here. gnome-session 3.38 switched to a meson build and some of the old build options we were using had to be changed. This lead to disabling several systemd-related build options. However, the disabling of these features is also what caused shutdown/restart to stop working (probably because gnome-session isn't using logind). If you install gnome-session from extra (Arch's repo), it works fine. Most likely, the "systemd-session" option needs to be patched with elogind support. I actually had to do something similar for GDM so I'll write up a patch for Artix real quick. Thanks for investigating!

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #8
I wrote a small/dirty patch for building against elogind, tested it on my machine and it worked as expected. I went ahead and pushed a new version of gnome-session to the repos. It should resolve the issue. I'll coordinate with upstream and see if we can get this feature accepted.

Edit: Haha, I just realized that an elogind MR request for gnome-session already existed. Oh well, wasted some extra time going through gnome-session code.

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #9
Yeah, the update of gnome-session fixed it for me, I will mark this as solved. Thanks to everyone for the help. I love communities like this.

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #10
Yeah, the update of gnome-session fixed it for me, I will mark this as solved. Thanks to everyone for the help. I love communities like this.
Turns out I cannot mark it as solved myself, welp.

Re: Shutdown and Restart buttons not working on GNOME 3.38

Reply #11
Edit: Haha, I just realized that an elogind MR request for gnome-session already existed. Oh well, wasted some extra time going through gnome-session code.
Well, keep it up then, for the next releases @Dudemanguy :D