Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: streaks on 07 October 2020, 01:32:38

Title: Shutdown and Restart buttons not working on GNOME 3.38
Post by: streaks on 07 October 2020, 01:32: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!
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: ndowens on 07 October 2020, 01:48:03
This is something that is currently being talked about and trying to find a solution for it.
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: streaks on 07 October 2020, 02:44:54
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?
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: Dudemanguy on 07 October 2020, 05:19:39
We could possibly just delete that file on shutdown in the init scripts as a workaround. Nice find.
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: streaks on 07 October 2020, 06:44:39
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
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: streaks on 07 October 2020, 07:37:21
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.
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: linuxer on 07 October 2020, 09:39:57
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.
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: Dudemanguy on 07 October 2020, 15:26:39
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!
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: Dudemanguy on 07 October 2020, 18:39:31
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.
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: streaks on 07 October 2020, 21:09:13
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.
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: streaks on 07 October 2020, 21:10: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.
Title: Re: Shutdown and Restart buttons not working on GNOME 3.38
Post by: linuxer on 07 October 2020, 22:34:36
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