[SOLVED] updated Cent5 freenx and nx packages break xhost + . . .

General support questions including new installations
mwillc
Posts: 4
Joined: 2009/10/05 17:34:26

[SOLVED] updated Cent5 freenx and nx packages break xhost + . . .

Post by mwillc » 2010/12/17 00:36:38

No longer able to modify NX DISPLAY var to $HOSTNAME:NXPORT.0 and run "xhost +" successfully. This occurs after updating a CentOS 5 host with old nx freenx rpms
to the latest.

WORKING SCENARIO

Old RPMS:
nx-3.0.0-4.el5.centos.x86_64
freenx-0.7.1.svn416-3.el5.centos.x86_64

Using the above one can successfully do the following upon NX'ing into a host and opening a terminal:

bash-3.2$ echo $DISPLAY
:1006.0

bash-3.2$ export DISPLAY=$HOSTNAME:1006.0

bash-3.2$ xhost +
access control disabled, clients can connect from any host

bash-3.2$ echo $DISPLAY
myhost:1006.0

BROKEN SCENARIO:

New RPMS:
nx-3.3.0-14.el5.centos.x86_64
freenx-0.7.3-2.el5.centos.x86_64

bash-3.2$ echo $DISPLAY
:1000.0

bash-3.2$ export DISPLAY=$HOSTNAME:1000.0

bash-3.2$ xhost +
xhost: unable to open display "myhost:1000.0"

bash-3.2$ echo $DISPLAY
myhost:1000.0

Honestly I haven't spent the time figuring out at which point the rpms "broke" for me, looking at the repos there are a couple versions of nx and freenx between my working and broken examples above. I have tested on the very latest nx and freenx rpms and these are "broken" as well.

Then again, perhaps I'm doing something wrong and there is a better way to accomplish what I'm intending?

Thanks for any advice/suggestions.

Mark

User avatar
toracat
Site Admin
Posts: 7490
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

[SOLVED] updated Cent5 freenx and nx packages break xhost +

Post by toracat » 2010/12/17 01:17:50

Could you elaborate what you are trying to achieve? For example, if you skip the [i]export DISPLAY=$HOSTNAME:1000.0[/i] step, then [i]xhost +[/i] would yield [i]access control disabled, clients can connect from any host[/i]. In what situation do you need $HOSTNAME to be part of $DISPLAY? My understanding of use of xhost + is to allow anyone to use your X server. ??

mwillc
Posts: 4
Joined: 2009/10/05 17:34:26

Re: updated Cent5 freenx and nx packages breaks xhost + when modifying DISPLAY var to $HOSTNAME.1001.0

Post by mwillc » 2010/12/17 01:30:10

We use NX as an X gateway to a compute farm where users are free to submit "Interactive jobs". DISPLAY needs to incorporate the hostname in order for the job scheduler to create the correct environment for the job to run.

example:
1. bob NX's to NX host.
2. bob submits a job to Farm Scheduler
3. Farm Scheduler starts job on Farm Node A.
4. Farm node A redirects X back to NX host.

The above will not work unless DISPLAY incorporates the hostname of the NX host. Farm node A has no idea what either "unix:1000.0" or ":1000.0" is, but can figure out how to send GUI back to "nx_host:1000.0"

Thanks.

Mark

User avatar
toracat
Site Admin
Posts: 7490
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: updated Cent5 freenx and nx packages breaks xhost + when modifying DISPLAY var to $HOSTNAME.1001.0

Post by toracat » 2010/12/17 02:19:40

Can you try the following and see if that works?

Edit /etc/nxserver/node.conf

Change the line :

#AGENT_FONT_SERVER="-nolisten tcp"

to

AGENT_FONT_SERVER=""

[EDIT] Correction: it is supposed to be AGENT_EXTRA_OPTIONS_X=""

User avatar
toracat
Site Admin
Posts: 7490
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: updated Cent5 freenx and nx packages breaks xhost + when modifying DISPLAY var to $HOSTNAME.1001.0

Post by toracat » 2010/12/17 02:50:02

Sorry, pasted a wrong line. It is supposed to be this line:

AGENT_EXTRA_OPTIONS_X=""

(remove # and -nolisten tcp)

mwillc
Posts: 4
Joined: 2009/10/05 17:34:26

Re: [SOLVED] updated Cent5 freenx and nx packages breaks xhost + . . .

Post by mwillc » 2010/12/17 17:38:49

SOLVED - Toracat has provided the correct configuration.

Thank you, for taking the time and helping.


[root@ nxserver]# sed -e '/^#/'d -e '/^$/'d /etc/nxserver/node.conf
NX_LOG_LEVEL=4
NX_LOGFILE=/var/log/nx/nxserver.log
COMMAND_MD5SUM="md5sum"
AGENT_EXTRA_OPTIONS_X=""

[root@ nxserver]# service freenx-server restart
Restarting freenx-server:
Stopping freenx-server: [ OK ]

Starting freenx-server: [ OK ]


bash-3.2$ xhost +
access control disabled, clients can connect from any host
bash-3.2$ echo $DISPLAY
:1000.0
bash-3.2$ export DISPLAY=nxserver:1000.0
bash-3.2$ xhost +
access control disabled, clients can connect from any host
bash-3.2$ rpm -q nx freenx
nx-3.4.0-6.el5.centos.x86_64
freenx-0.7.3-6.el5.centos.x86_64
bash-3.2$

User avatar
toracat
Site Admin
Posts: 7490
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: [SOLVED] updated Cent5 freenx and nx packages breaks xhost + . . .

Post by toracat » 2010/12/17 17:47:43

I am so glad to hear that was the right solution.

In a recent update, node.conf was added to the default installation. Previously it was supplied as a .sample file and users used to manually add it if the file was required.

Now, I have a question. In your opinion, do you think that the newly edited line should be made the default ?

mwillc
Posts: 4
Joined: 2009/10/05 17:34:26

Re: [SOLVED] updated Cent5 freenx and nx packages breaks xhost + . . .

Post by mwillc » 2010/12/17 18:20:22

The argument for making it the default is to keep the functionality that was present in previous builds. However, you might argue the setting makes NX less secure (Frankly, I 'm not entirely sure what the security implications of the setting are).

I think I'd favor maintaining backward compatibility over possible security concerns.

I'll be happy with whatever you decide. Thanks to you, I now know how to tweak NX to do what I need to, and have already modified my "Puppet" module to enforce the config.

Thank you.

Mark

User avatar
toracat
Site Admin
Posts: 7490
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: [SOLVED] updated Cent5 freenx and nx packages breaks xhost + . . .

Post by toracat » 2010/12/17 19:30:51

Thanks for your thoughts. I think I will leave the file as it is for now.

User avatar
toracat
Site Admin
Posts: 7490
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: [SOLVED] updated Cent5 freenx and nx packages breaks xhost + . . .

Post by toracat » 2010/12/21 19:44:19

I have added a note to the troubleshooting section of the [url=http://wiki.centos.org/HowTos/FreeNX?action=show#head-9856033554572040562dcd5b88ba5f3af6e86e6a]FreeNX wiki[/url] page.

Post Reply