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.
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.
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 ?
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
looks interesting to me..
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... :-)
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.
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?
This bug is resolved ? or not ? Thank's In My system reboot o shutdown with GDM do not work
i still get this error reported on shutdown/reboot
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.
Of course I meant [gkx]dm in both cases.
isn't that a bit overdone and wouldn't it interfere with 'normal' usage (not shutdown) ?
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.
why not create a seperate init script for gdm alone? what that be so bad?
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.
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 ?
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.
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
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.
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?
Fixed in 6.8.2-r2 and 6.8.99.5. Thanks!
*** Bug 93815 has been marked as a duplicate of this bug. ***
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