[FreeNX-kNX] LTSP Startup Script
Dimitar Paskov
pascoff at nola7.com
Mon Oct 8 09:40:35 UTC 2007
На 5.10.2007 18:26 Terje Andersen пише:
> On Fri, 2007-10-05 at 10:17 -0500, Joe Baker wrote:
> > Dimitar Paskov wrote:
> > >> It would be great if we could get some GPLed nx client and startup
> > >> script added to the LTSP project.
> > >
> > > I have some ltsp scripts to start nxclient with an ltsp terminal. If
> > > you are interested I can send them to you.
> >
> > Yes, please send the script. I do not mind running nxclient here on our
> > LAN for the time being.
> >
> > Thank You!
>
> Dimitar, it would be nice if you could post them to the list, I'm sure
> more then one could have use for them (including me :p).
>
I'm using ltsp under Ubuntu 6.06 and the script that starts xdm/gdm/telnet or
whatever it is installed on the thin client environment
is /etc/init.d/ltsp-client. The script executes another scripts that are
located in /usr/lib/ltsp/screen.d/ and they are defined in the
file /etc/lts.conf as SCREEN_01, SCREEN_02, etc. For example if I put
SCREEN_01=telnet in /etc/lts.conf it will
execute /usr/lib/ltsp/screen.d/telnet. So I made a script called "nx" and
place it in /usr/lib/ltsp/screen.d/ and assign it in /etc/lts.conf ->
SCREEN_01=nx. The script is divided in 3 parts for convenience:
/usr/lib/ltsp/screen.d/nx:
-------------------------------------
#!/bin/sh
while true; do
/usr/bin/xinit /usr/lib/ltsp/start_nx -- :0 vt2
sleep 1
done
-------------------------------------
This fires up X on tty2 and starts /usr/lib/ltsp/start_nx (the second script):
-------------------------------------
#!/bin/sh
# set the background
/usr/bin/xsetroot -solid black
# set some variables
export NXDIR=/usr/NX
export HOME=/root
# start the window manager
ion &
# start nxclient
/usr/bin/runnxclient
-------------------------------------
Here I set the background and some variables, start a minimal window manager
(more on that later) and finally execute the 3rd script that actually starts
nxclient (/usr/bin/runnxclient):
-------------------------------------
#!/bin/sh
while true; do
# start nx client with predefined session
/usr/NX/bin/nxclient --config /etc/ltsp/nx/config/nxclient.conf --session /etc/ltsp/nx/config/linux.nxs
# sleep until nxclient(nxssh) is running
while (ps -C nxssh > /dev/null); do
sleep 1
done
done
-----------------------------------
I make a loop that restarts nxcleint whenever it stops running. Actually
nxclient as a process finishes as long as the user logs in and is replaced by
nxssh so I wait until it exits. I start nxclient with a predefined session
and a little trick that forbids the user to change parameters on the client -
I create empty files in /usr/NX/share/: noconfig nopasswd. This is optional
of course.
You can skip some of the scripts if you don't need them for example you can
skip the second script that actually only starts a window manager ... you can
go without a window manager but then there is a little problem that I
couldn't solve: the key repeat rate is disabled unless nxclient is executed
under some window manager. I didn't have time to dig into it so if you find a
solution please tell me ;) The window manager (ion2) is very minimal and
displays only a top frame on the login screen with nxclient. After nxclient
passes login and opens the session, that frame disappears (it goes to
full-screen mode) and the user don't know that they work under terminal
session at all :)
I hope this helps and if you have any questions don't hesitate to ask :)
ps: I use nxclient 1.5 version
More information about the FreeNX-kNX
mailing list