[CentOS] telnet and Gnome logins

Kanwar Ranbir Sandhu m3freak at thesandhufamily.ca
Tue Mar 27 18:46:42 UTC 2007

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.



Kanwar Ranbir Sandhu
Linux 2.6.20-1.2925.fc6 i686 GNU/Linux 
14:28:20 up 4 days, 5:25, 3 users, load average: 0.17, 0.16, 0.18 

More information about the CentOS mailing list