Re: [Ltsp-discuss] Power Management for individual clients

2008-12-01 Thread Anton Vaaranmaa
Oliver Grawert wrote:

 hi,
 Am Samstag, den 29.11.2008, 21:05 +0200 schrieb Anton Vaaranmaa:
 Question is: how do I power off harddisks for these two thin clients 
 only? (It would not hurt either to know how to power manage things like 
 monitors..)
 i would suggest creating an initscript in your chroot, make it read an
 lst.conf variable (all variables in lts.conf are exported globally, so
 you should easily be able to read them if your script runs after the
 ltsp-client-setup initscript) ...
 just make it fire and set the necessary hdparm values if you detect a
 certain lts.conf variable ... then set this variable for the MAC
 adresses of the two clients in lts.conf ... 
 
 (easiest might be to (ab)use /etc/rc.local for this)
 
 ciao
   oli

Hi,

Thank you very much for your advice. My scripting skills are very modest
to say at least, so I used the RCFILE_01 = script approach and in my
script I put the hdparm -Y /dev/sda command. I can target the
client(s)that need this by placing the RCFILE_01 variable under the
section for the individual client(s) in lts.conf. However when I tested
it I had no luck since the command did not get executed at all :-( When
I execute my script manually in a shell it works. I did remember to do
an ltsp-update-image after putting the script init /etc/init.d/.

-- 
Anton


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
_
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
  https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net


Re: [Ltsp-discuss] LTSP4.2 autologin

2008-12-01 Thread Gideon Romm
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 

Re: [Ltsp-discuss] Power Management for individual clients

2008-12-01 Thread Vagrant Cascadian
On Mon, Dec 01, 2008 at 01:12:21PM +0200, Anton Vaaranmaa wrote:
 Thank you very much for your advice. My scripting skills are very modest
 to say at least, so I used the RCFILE_01 = script approach and in my
 script I put the hdparm -Y /dev/sda command. I can target the
 client(s)that need this by placing the RCFILE_01 variable under the
 section for the individual client(s) in lts.conf. However when I tested
 it I had no luck since the command did not get executed at all :-( When
 I execute my script manually in a shell it works. I did remember to do
 an ltsp-update-image after putting the script init /etc/init.d/.

what exactly is in RCFILE_01? you need to use the full path:

RCFILE_01 = /FULL/PATH/TO/script

i.e. if you placed it in /etc/init.d, then RCFILE_01 = /etc/init.d/script

are other lts.conf values being respected? where is your lts.conf file?

live well,
  vagrant

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
_
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
  https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net