We have a Gnome session running on our remote server. How can we ssh into the machine and shutdown X-Windows without restarting the machine?
Well, are you trying to just shutdown X because of a locked application and restart it, or do you just want to stop X from running entirely?
Assuming you want to just kill X because of a locked-up application: (examples below are from my OpenSolaris-based server, probably not applicable to Sol8 or 9)
bill@aperture:~# kill -9 2478 bill@aperture:~# ps ac | grep Xorg 2593 vt/2 S 0:00 Xorg bill@aperture:~# kill -9 2593 bill@aperture:~# ps ac | grep Xorg No immediate results, wait a few seconds to run check again bill@aperture:~# ps ac | grep Xorg 2631 vt/2 S 0:00 Xorg
Notice that in this case, X restarted. While this may be good if you're just trying to restart X after a lockup, sometimes you just want to shut GDM off entirely. Check svcs for an entry for GDM.
bill@aperture:~# svcs | grep gdm online 9:10:05 svc:/application/graphical-login/gdm:default
Well, look, I've got an entry for GDM. Thanks to the wonders of SMF, no matter how hard I try, I can't kill X. It keeps coming back from the dead. Let's tell GDM to die-- no, let's just disable it via svcadm.
bill@aperture:~# ps acx | grep gdm 2701 ? S 0:00 gdm-binary 2702 ? S 0:00 gdm-binary 2727 ? S 0:01 gdmgreeter bill@aperture:~# ps acx | grep Xorg 2703 vt/2 S 0:00 Xorg bill@aperture:~# svcadm disable gdm bill@aperture:~# ps acx | grep gdm bill@aperture:~# ps acx | grep Xorg bill@aperture:~#
As a further note, I found this mailing list thread helpful once upon a time, to fix the inability to use Ctrl-Alt-Bksp to kill X on Solaris. Basically, add a few lines to the configuration file for X.org to reenable handling of Ctrl-Alt-Bksp on certain Solaris installs.