Shutdown from g-p-m doesn't use uspash
Bug Description
When run on battery and battery level is critical enough for g-p-m to shutdown my notebook, the shutdown process is not beautified with usplash like it is when shutting down from gdm, session logout dialog or 'restart' notification icon.
Running Dapper, g-p-m 2.13.93-0ubuntu3
I'm not involved in any development of update-notifier and/or gdm but this is what I've found.
From update-
static void
request_reboot (void)
{
GnomeClient *client;
char *cmd[] = { GDM_SIGNAL, "--reboot", NULL };
client = gnome_master_client ();
g_return_if_fail (client != NULL);
/* Tell gdm to reboot once we exit the session */
g_spawn_sync (NULL, cmd, NULL, G_SPAWN_
NULL, NULL, NULL, NULL, NULL, NULL);
/* Tell gnome-session to save and exit the session without asking
* the user. */
gnome_
TRUE,
FALSE,
TRUE);
}
This is one of ubuntu patches (gdm/debian/
--- gdm-2.8.
+++ gdm-2.8.
@@ -50,6 +50,10 @@
if [ -e "$DEFAULT_
log_warning_msg "Not starting GNOME Display Manager (gdm); it is not the default display manager."
else
+ # if usplash is runing, make sure to stop it now, yes "start" kills it.
+ if pidof usplash > /dev/null; then
+ /etc/init.d/usplash start
+ fi
log_begin_msg "Starting GNOME Display Manager..."
start-
log_end_msg 0
--- gdm-2.13.
+++ gdm-2.13.
@@ -601,6 +601,13 @@
static void
change_
{
+ if (WEXITSTATUS(
+ if (restart)
+ system(
+ else
+ system(
+ } else {
+
gdm_change_vt (1);
VE_IGNORE_EINTR (close (0));
VE_IGNORE_EINTR (close (1));
@@ -624,6 +631,8 @@
printf (_("System is shutting down, please wait ..."));
/* set to black */
printf ("\033[
+
+ }
}
#endif /* __linux__ */
If I understand it right, g-p-m just sets policy for hal and hal takes care of shutdown even if GNOME is currently not running. Am I right?
Ideally the hal-system-
Okay, thanks for doing the research on that. Condensing all you've found, does (as root):
/sbin/usplash_down
/sbin/usplash_write "System is shutting down, please wait..."
/sbin/shutdown -h now
shut your system down with usplash okay?
>Ideally the hal-system-
>computer via gdm
Nahh, this is the wrong way round, gdm should ask hal that it wants to shutdown, as hal is not aware of anything "per-session" as it's "per-system". The hal-system-
This abstraction allows gdm/g-p-m/whatever to call the Shutdown() dbus methods without worrying about "how" the method is performed, and any tweaks only have to be done in one place (e.g. gdm, kdm, etc).
Richard.
> /sbin/usplash_down
> /sbin/usplash_write "System is shutting down, please wait..."
> /sbin/shutdown -h now
>
> shut your system down with usplash okay?
Unfortunately it doesn't. It switches usplash on and writes "System is
shutting down ...." but then it blinks (probably during the stop of gdm)
and continues without usplash (even without text console shutdown, just
console login prompt is shown). Probably bug in gdm (in ubuntu).
> >Ideally the hal-system-
> >computer via gdm
>
> Nahh, this is the wrong way round, gdm should ask hal that it wants to
> shutdown, as hal is not aware of anything "per-session" as it's "per-
> system". The hal-system-
> the actual shutdown, with distro tweaks (like the usplash thing) and
> where files are not in standard locations between distros.
>
> This abstraction allows gdm/g-p-m/whatever to call the Shutdown() dbus
> methods without worrying about "how" the method is performed, and any
> tweaks only have to be done in one place (e.g. gdm, kdm, etc).
I see, so current gdm behaviour is wrong (?). gdm should use hal to
reboot/shutdown.
Probably, this problem should be discussed with Ubuntu's gdm maintainer.
Pogo (that's me - Jan Mynarik :-))
>gdm should use hal to reboot/shutdown.
In an ideal world, yes. Then all the stuff like invoking usplash "just works" when you use gdm, g-p-m, kdm, whatever.
If:
/sbin/usplash_down
/sbin/usplash_write "System is shutting down, please wait..."
:works, then can you find out how gdm shuts down the system without blanking the screen? Thanks.
Richard.
Descreasing the priority as this only happens when the user wasn't paying attention to the machine anyway!
Closing this because there's been nothing for 2months and I was the last person to touch it anyway.
Please re-open if this is still happening.
I, as a reporter, didn't add anything else because from my point of view the report was complete. I thought this bug has been moved to dapper+1 and was to be fixed.
Confirmed, this is a duplicate and I also had it this morning.
I'm not sure if this is a duplicate of recently seen behaviour (usplash doesn't show up immediately after shutdown from gnome-session). usplash has not been used for shutdown from g-p-m even when it worked perfectly from both gdm and gnome-session.
Daniel suggested that by mail:
"The usplash being late in shutdown is probably due to hal's shutdown
helper. Check out the script in the hal package for shutting down the
machine /usr/share/
calls shutdown -h now where perhaps it should call usplash_down first?"
@seb128:
That's what Richard said in comments. Ideally, even gdm should use hal-system-
this shouldnt be minor, and be major, it completely hangs up the shutdown on 2 of my laptops, and i have to manually shut it down by holding the power button, or select restart then hit the power button once to send the term signals, very annoying on a laptop
battery charged, pluged in, unpluged it always does it
> this shouldnt be minor[...]
I agree. "Usplash down" is one of the "main" features of the new Dapper. If you see:
http://
"No Linux distribution has had a complete graphical shutdown process... until now. Starting with Flight 5, Ubuntu 6.06 now uses usplash to provide a graphical shutdown screen. This gives Ubuntu a more professional and user friendly feel overall. Users now see almost no text messages on the startup and shutdown screens."
Obviously, "Usplash down" makes the difference with other distros, and IMHO it should be fixed in order to get it working perfectly before Dapper release.
The shutdown action from the session dialog is fixed with that upload:
gnome-session (2.14.1-0ubuntu11) dapper; urgency=low
.
* debian/
debian/
- use only one patch, no need to have differents ones for the same feature
- use GDM for shutdown action, fix usplash transition (Ubuntu: #35182)
works for me now, can I close this bug or is there still some more stuff to be done here?
the original description of the bug still applies so better to let it open
As reporter, I will try the fix tonight and let you know.
The original bug hasn't been fixed; its impact was expanded when we started using g-p-m for normal shutdown and reboot. Sebastien's change has reverted to the old behaviour, so this bug once again only affects shutdowns triggered by g-p-m.
So finally, I can confirm that the original bug report is still valid. g-p-m doesn't use usplash when shutting down computer due to empty battery. Normal shutdown is using usplash though.
Shouldn't this bug be changed to "open" again?
Yes, re-open it if it's a bug and still present. It's fairly low priority though, because g-p-m will only shutdown the machine if nobody is around; and if nobody is around, nobody will see the lack of usplash :)
What is exactly the problem? The shutdown process works well for me (even the usplash down). Although I have a desktop computer, not a laptop...
Usplash is not used when gnome-power-manager shuts down the computer due to a critical battery level (0%).
Is this still happening on Gutsy? Removing dapper milestone.
I will try to test it in Gutsy this week.
I'm unable to test it as g-p-m doesn't currently do anything on low battery. And I've got it configured correctly in Power Management. Will look if there is a bug for this.
I will test it once g-p-m works for me on low battery.
Finally got to test it in gutsy (after problem with usplash not working at all). For me it's still not working (usplash during shutdown due to critical batter level).
At the moment, hal-system-
power-shutdown has this:
#Try for common tools
/sbin/ shutdown -h now shutdown" ] ; then
/usr/sbin/ shutdown -h now
if [ -x "/sbin/shutdown" ] ; then
exit $?
elif [ -x "/usr/sbin/
exit $?
else
unsupported
fi
so that it works on all distros. On Ubuntu, how do you shutdown on the command line so that usplash activates? It's easy to add to upstream hal if you give me the command.
Richard.