[FreeNX-kNX] DPI an issue with 1.5?

Gian Filippo Pinzari pinzari at nomachine.com
Tue Sep 20 13:15:58 UTC 2005


Kurt Granroth wrote:
> Curiously, !M nxserver and FreeNX nxserver start up the user  
> differently.
> When I used FreeNX, everything just worked "out of the box".  I had  
> to do
> some digging around to get !M nxserver to work, though.  Specifically,
> my main test user uses zsh as the main shell and there is no system wide
> /etc/zprofile or zlogin nor no local .zprofile or .zlogin.   
> Nevertheless,
> however FreeNX nxserver was logging in as my test user got the full  
> path.
> The !M nxserver strictly uses a login shell which did NOT source my  
> normal
> path setting configs and so it couldn't find anything outside of
> /bin:/usr/bin (namely xauth and startkde).  A quick addition  
> of .zprofile
> fixed that ... but it was still curious and unexpected that there was  
> the
> difference.

I asked Marcin to dig into this. Here is his reply:

-------- Original Message --------
Subject: Re: PATH and sourcing of startup scripts
Date: Mon, 19 Sep 2005 23:34:04 +0200
From: Marcin Wiszniewski <wiszniewski at nomachine.com>
To: Gian Filippo Pinzari <pinzari at nomachine.com>
CC: Silvia Regis <regis at nomachine.com>,	Grzegorz Kryza <kryza at nomachine.com>
References: <B3894006-894A-4442-8519-B9F011AC1F86 at granroth.org>	<432D54ED.7010509 at nomachine.com> <93FC3DC3-A225-4415-894C-56FA1C014F59 at granroth.org> <432EF25F.6010503 at nomachine.com>

Im checking the freenx code and nxnode especially. There is a nxnode-login
which runs:

set pid [spawn -noecho su - "$user" -c "$executable $command" ]

Then before exec startkde or another command freenx's nxnode always runs:

  . /etc/profile
  [ -f ~/.bash_profile ] && . ~/.bash_profile

That's all, but I can't be sure because I'm not a freenx expert. For me
this means that the zsh problem is caused by a wrong configuration in the
user's or in the system's environment. For example, if the user sets the
PATH for the system inside /etc/profile, than freenx will be work 'out of
the box' while NX needs that the user fixes the zsh login's script. Our
way to set the user environment complies with the behaviour of the 'su -'
command. You find the description from 'info su' below:

[cut]
`-'
`-l'
`--login'
      Make the shell a login shell.  This means the following.  Unset all
      environment variables except `TERM', `HOME', and `SHELL' (which
      are set as described above), and `USER' and `LOGNAME' (which are
      set, even for the super-user, as described above), and set `PATH'
      to a compiled-in default value.  Change to USER's home directory.
      Prepend `-' to the shell's name, intended to make it read its
      login startup file(s).
[cut]

We don't set USER and LOGNAME, and don't make a chdir as our nxnode is
executed by ssh which already sets them and also sets 'pwd' to the user's
home. For the rest, we execute the user's shell by prepending '-', as
su does, to let the shell read its startup scripts.

-------- End of Original Message --------

It seems to me that FreeNX runs /etc/profile and ~/.bash_profile
explicitly, while NoMachine NX doesn't. I don't know which approach is
the best, though AFAICS the NoMachine NX behaviour seems correct. I'd
like to know your opinion on the matter.

/Gian Filippo.





More information about the FreeNX-kNX mailing list