Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24399 - Error stopping GDM on shutdown
Summary: Error stopping GDM on shutdown
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: Inclusion
: 93815 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-13 12:30 UTC by Andrew Joyce
Modified: 2008-01-29 17:27 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Joyce 2003-07-13 12:30:49 UTC
On shutdown when using GDM to login to X an error is displayed telling the user
that there was a problem stopping GDM.  This is not a critical error as it only
occurs because GDM has already quit itself when the user selects shutdown within
it.  It does however look bad, and I don't think that an error should be being
displayed to the user when everything is operating normally.

I would like to propose the following change to /etc/init.d/xdm so that the
error doesn't display if GDM is not running.

--- /tmp/xdm.old        2003-07-13 16:44:48.000000000 -0400
+++ xdm 2003-07-13 16:46:13.000000000 -0400
@@ -98,7 +98,7 @@
 
                retval=$?
        else
-               retval=1
+               retval=0
        fi
 
        #switch back to original vt


Reproducible: Always
Steps to Reproduce:
1. Setup GDM as your login manager for X.
2. Shutdown your computer using the GDM interface and observe the ugly error
message.
Comment 1 Mike Gardiner (RETIRED) gentoo-dev 2003-08-22 09:47:49 UTC
does this display-manager-shutting-itself-down occur with all display managers ? or only with gdm ? (perhaps try xdm to check). your patch proposes (logically) that 

if (the display manager is running)
stop it and return it's exit value
else ( ie we cant see the display manager running!)
assume everything is ok and return 0

which i think is inconsistent with the intended behaviour, ie if we cant see the display manager running then there's a good chance something went wrong, so return 1. either way i think it's an xfree team decision.
Comment 2 foser (RETIRED) gentoo-dev 2003-08-22 09:57:00 UTC
this is a known 'problem' , it's just that if you shutdown or reboot from gdm , gdm gets stopped before the rc-script can stop it. That leads to an error because according to the rc script it should still be running.

It's a superficial problem that has no real solution. If we change the rc-script we actually make it bugged, because it will return 0 whenever gdm is not running when we issue a stop of the script. While this should be 1 because gdm isn't running anymore and that's an error (according to the script its an error if gdm isnt running after it was started by the script).

It's a choice between 2 bads.

Azarah, it's time to fix this for once and all. What about making adding something so GDM being stopped doesn't count as an error ?
Comment 3 Radek Podgorny 2003-09-10 15:43:54 UTC
Can't this be solved by replacing the "ShutdownCommand=shutdown -h now" (or something similar -> can't look now) to something like "/etc/init.d/xdm stop; shutdown -h now" in the /etc/X11/gdm.conf file?

Radek
Comment 4 foser (RETIRED) gentoo-dev 2003-09-10 15:46:58 UTC
looks interesting to me..
Comment 5 Radek Podgorny 2003-09-10 17:44:57 UTC
Anyway, it's nothing more than an idea... It may work but it may not... :-(

Can't test it myself so it's up to you, Gentoo guys, now... :-)
Comment 6 foser (RETIRED) gentoo-dev 2003-11-23 10:25:30 UTC
suggestion in #3 doesn't work either, it still shuts down gdm before anything is done.

So the change still needs to be done in xdm init . Azarah, could we get some sort of hack in /etc/init.d/xdm for gdm to be disregarded when it's already stopped ? I know it's not clean, but this keeps coming back up.

We could maybe hack gdm to create a tmp file before it exists and then check if the tmp file exists in xdm init. Ugly, but it would probably work correctly most of the time.
Comment 7 afd 2003-12-17 19:48:44 UTC
would it work to add some entry
foo() { eend 0 }
to /etc/init.d/xdm and to invoke /etc/init.d/xdm foo;[...;]shutdown -h now when halting the system?
Comment 8 Antonio 2004-04-02 01:51:21 UTC
This bug is resolved ? or not ?
Thank's
In My system reboot o shutdown with GDM do not work
Comment 9 Arthur Jackson 2004-06-16 13:36:18 UTC
i still get this error reported on shutdown/reboot
Comment 10 Maurice van der Pot (RETIRED) gentoo-dev 2004-07-20 12:26:10 UTC
What about having a wrapper process that starts xdm in the foreground, catches the exit code when it shuts down and then waits for signal 15 before exiting itself and returning the caught error code.

That way you can always see if gdm was shutdown cleanly and you don't get an error if it exited normally before being shut down.
Comment 11 Maurice van der Pot (RETIRED) gentoo-dev 2004-07-20 12:28:43 UTC
Of course I meant [gkx]dm in both cases.
Comment 12 foser (RETIRED) gentoo-dev 2004-08-08 05:35:12 UTC
isn't that a bit overdone and wouldn't it interfere with 'normal' usage (not shutdown) ?
Comment 13 Maurice van der Pot (RETIRED) gentoo-dev 2004-08-08 11:31:28 UTC
My suggestion only works if the display manager is forced to run in the
foreground, but because the same script is used for several different
display managers, I would not recommend this. 

If no distinction can be made between a successful early termination and 
an unsuccessful one, imho the most common one should be assumed, which
is the successful one. I have to agree with the submitter.

Reassigning to xfree so they can decide and fix this.
Comment 14 gad.kadosh 2004-10-04 17:46:18 UTC
why not create a seperate init script for gdm alone? what that be so bad?
Comment 15 Tim Burrell 2004-12-17 07:33:46 UTC
I just wanted to add that I find this annoying too.  A fix would be greatly appreciated.

I hate setting up gentoo on a friends computer and of course they _always_ ask "WAIT! What was that error!?"  and I have to explain "Oh don't worry, that's nothing, the gentoo team hasn't found a fix for that yet, but really it's nothing."

Kinda scares people a bit.  Which is fine if you've been using gentoo for a while, but for newbs I can understand it being unsettling.
Comment 16 foser (RETIRED) gentoo-dev 2004-12-17 07:37:25 UTC
if i remember correctly i saw a commit not so long ago by azarah to the xdm script that supposedly fixes this. Am I right Az ?
Comment 17 Martin OConnor 2005-01-19 03:57:33 UTC
change "ShutdownCommand=shutdown -h now"  to
"/etc/init.d/xdm zap; shutdown -h now" in the /etc/X11/gdm.conf 

zap causes the xdm script to be manually reset to the stopped state - suppressing the error on shutdown.
Comment 18 Martin OConnor 2005-01-19 04:07:12 UTC
That should be
change "HaltCommand"  to
"HaltCommand=/etc/init.d/xdm zap && /sbin/poweroff" 
and "RebootCommand" to
"RebootCammand=/etc/init.d/xdm zap && /sbin/reboot"
in the /etc/X11/gdm.conf 
Comment 19 Martin OConnor 2005-01-19 04:33:54 UTC
On testing the above won't work
the solution is:
That should be
change "HaltCommand"  to
"HaltCommand=/sbin/gdm-poweroff" 
and "RebootCommand" to
"RebootCammand=/sbin/gdm-reboot"
in the /etc/X11/gdm.conf 

create /sbin/gdm-poweroff
#!/bin/bash
/etc/init.d/xdm zap &>/dev/null
/sbin/poweroff

chmod 0755 /sbin/gdm-poweroff

create /sbin/gdm-reboot
#!/bin/bash
/etc/init.d/xdm zap &>/dev/null
/sbin/reboot

chmod 0755 /sbin/gdm-reboot

Tested - works.
Comment 20 Martin Ehmsen (RETIRED) gentoo-dev 2005-04-25 23:56:35 UTC
The solution in #19 seems nice.
It fixes the issue for gdm and dosen't interfere with other display managers.
Any opinions from gentoo devs?
Comment 21 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-23 20:12:56 UTC
Fixed in 6.8.2-r2 and 6.8.99.5. Thanks!
Comment 22 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-24 10:18:20 UTC
*** Bug 93815 has been marked as a duplicate of this bug. ***
Comment 23 Mark Anthony 2008-01-29 17:27:47 UTC
I am momentarily using kernel 2.6.23-gentoo-r6 and gdm (~)2.20.3 and wonder:
I get 'error stopping gdm' while shutting down from X. 

/var/log/messages gives this:
Jan 29 17:18:31 localhost gdm[5917]: pam_unix(gdm:session): session opened for user Enrond by (uid=0)
Jan 29 18:08:03 localhost gdm[5917]: pam_unix(gdm:session): session closed for user Enrond
Jan 29 18:08:03 localhost gdm[5916]: WARNING: main daemon: Got SIGABRT. Something went very wrong. Going down!
Jan 29 18:08:08 localhost rc-scripts: Error stopping gdm

So this seems to be the same problem as before ;) If i am wrong please tell me and / or if you need any additional information about my setup just ask.

Enrond