On Tue, 2007-03-27 at 13:04 -0500, Jay Leafey wrote:
How about making the console app execution conditional on the presence of an X display variable:
[ -z "${DISPLAY}" ] && exec app
This way, if the display variable is set (i.e. he logged in via the thin client or NX) the application does not run, but if he logs in via telnet or SSH (without X forwarding) he gets the application. You might need to do some more checking for cron/at jobs too.
Neat: I got the same idea a few minutes after posting my message. But, it didn't appear to work when I logged in with the NX client. Your post, however, got me thinking that maybe it was just the NX client throwing things off.
Sure enough, after connecting with Xnest, I got the normal Gnome desktop. Logging in with ssh or telnet gives me the console app. Nice.
I wonder now why NX client is behaving differently. I know that first it uses ssh, and then the user logs in over the ssh connection. NX is probably seeing $DISPLAY set as null when the ssh connection is made, and then the console app kicks in which prevents gnome-session from starting. I don't know if that's really what is happening. I'm not sure how to work around it in any case.
Thanks for the tip. It helped me realize I hadn't tested with a simple remote X client.
Regards,
Ranbir