I solved the problem!
I actually discovered that X is killed at an advanced stage of the reboot/shutdown procedure. So, stopping gpm after X didn't work. I noticed that as soon as /sbin/reboot or /sbin/halt were executed, the screen would switch to the shutdown bootsplash and the mouse problem would be present.
So, this is what I did, for future reference. In /usr/local/sbin, which in my PATH variable comes before /sbin, I created two wrappers for halt and reboot.
Wrapper for halt (called halt)
Code: Select all
#!/bin/bash
/bin/rc-status -a | grep -v stopped | grep -q gpm && /etc/init.d/gpm stop > /dev/null
/sbin/halt
wrapper for reboot (called reboot):
Code: Select all
#!/bin/bash
/bin/rc-status -a | grep -v stopped | grep -q gpm && /etc/init.d/gpm stop > /dev/null
/sbin/reboot
Please not that the syntax for the rc-status line was changed a little bit from the example posted here. (Thank you for posting it!!!!)
I then changed the permission to be able to execute the wrappers
Code: Select all
cd /usr/local/sbin
chmod +x reboot
chmod +x halt
Since I use KDM as login manager, I logged in to kde, went to the control center -> system administration -> login manager. Changed to administrator mode, went to the shutdown tab, and changed the halt and reboot commands to /usr/local/sbin halt and /usr/local/sbin/reboot
This way gpm is correctly killed before the shutdown splashscreen comes up. This happens both when I reboot from a console (the wrappers come first in the PATH) and when I reboot from X (kdm launches the wrappers to reboot).
During the boot sequence, I can start the gpm service in local.start as described above (or whenever I feel like, for all that matters)
This is not very elegant, but it works!!! If you have another better idea please let me know! Thank to all those who helped! I learned a lot thank to you!
Valerio