Gabriel,
How about we cheat? The script below (starting with: #!/bin/sh) should
work whether it is IP or hostname.
Try this script:
# BEGIN SCRIPT ##
#!/bin/sh
CLIENT=$(echo $DISPLAY | cut -d: -f1)
CLIENT1=$(echo $CLIENT | cut -d. -f1)
CLIENT1_CHECK=$(echo $CLIENT1 | sed -e 's/[0-9]*//g')
USER_PREFIX=auto
if [ -z ${CLIENT1_CHECK) ]; then
# CLIENT is an IP
echo ${USER_PREFIX}$(echo $CLIENT | cut -d. -f4)
exit 0
else
# CLIENT is a hostname
echo ${USER_PREFIX}$(echo $CLIENT1 | sed -e 's/^[a-zA-Z0]*//')
exit 0
fi
# END SCRIPT##
-Gadi
On Wed, 2008-11-26 at 17:14 +, gabriel lopez wrote:
Gideon:
Thanks for this detailed explanation.
I am not a programmer and just copied the script i found in internet
but did not know what was it doing.
Now i undestand a little more.
On the script i added a line to echo $DISPLAY and $CLIENT to a file
and the restarted the client.
The values are:
Display 192.168.20.120:0
Client 192.
quote:
If that is the problem, then you ask - why is gdm using IP and not
hostname? Does my workstation have a hostname? Is my /etc/hosts
correct? Or, does gdm no longer resolve DISPLAY to hostname? Well,
the
first two are easy to check.
How do i check which could be the problem?
Mi /etc/hosts is like this
-
127.0.0.1lofa localhost
## lofa-begin ##
#
# The lines between 'lofa-begin' and 'lofa-end' were added
# on: Fri Oct 24 08:01:52 2008, by the lofacfg configuration tool.
# For more information, visit the lofa homepage
# at http://www.lofa.org
#
192.168.20.1 ws001.lofaws001
192.168.20.2 ws002.lofaws002
.
.
.
192.168.20.120 ws120.lofaws120
192.168.20.121 ws121.lofaws121
192.168.20.122 ws122.lofaws122
192.168.20.123 ws123.lofaws123
.
.
192.168.20.252 ws252.lofaws252
192.168.20.253 ws253.lofaws253
## lofa-end ##
--
Date: Tue, 25 Nov 2008 11:39:51 -0500
From: [EMAIL PROTECTED]
To: ltsp-discuss@lists.sourceforge.net
Subject: Re: [Ltsp-discuss] LTSP4.2 autologin
Gabriel,
It is always best to understand how the scripts should work before
implementing them - otherwise it makes things harder to debug.
Your instructions are basically making use of gdm's ability to
specify a
script to be executed when retrieving the autologin user. The output
of
such a script *must* be a valid username. If the output of the
script
is empty (no output), then gdm will use the root user.
Now, since that is what gdm is using, it tells you that the script
is
indeed not returning a username as output. Let's look at the script
and
figure out why:
The first line in the script cuts the DISPLAY environment variable
by
periods and returns the first part. It will use this first part to
figure out what user to return. That works ok, provided that the
first
part of the DISPLAY variable is a workstation name. Is it?
If it is not a hostname but an IP address, the result of returning
the
first part would be a number! That number would not match any of the
cases you set up and therefore return no autologin user. That could
be
the problem.
How to check? Well, tell the script to return $CLIENT. Then, if it
is
a number, gdm may say User 192 will login in 5 seconds... And you
will
say to yourself, User 192?!
If that is the problem, then you ask - why is gdm using IP and not
hostname? Does my workstation have a hostname? Is my /etc/hosts
correct? Or, does gdm no longer resolve DISPLAY to hostname? Well,
the
first two are easy to check. If you discover it is #3, then you may
need to modify your script to autologin users based upon IP rather
than
hostname.
Hope that helps,
-Gadi
On Mon, 2008-11-24 at 21:01 +, gabriel lopez wrote:
GDM LTSP4.2 Autologin‏
De:
gabriel lopez
([EMAIL PROTECTED])
Enviado:
viernes, 21 de noviembre de 2008
03:59:32 p.m.
Para:
LTSP
(ltsp-discuss@lists.sourceforge.net)
I am in the process of installing LTSP4.2 on Mandriva 2009. There
has
been problem because i has not found specific instructions for
Mandriva 2009 but Instructions for Mandriva 2006 and 2007 work 95%
of
the time.
What i have to solve now is autologin on terminals.
I have tried instructions for KDM and GDM and none works.
I has gone back to GDM and use this instructions:
#
Create a user ID for each client machine that will autologin. This
how-to assumes the IDs are auto1, auto2, auto3, etc.
Create the