lilalo

changeset 108:0d49f33696b3

Исправлены ошибки:
* инсталляция агента в .bash_profile - была проблема с переводом строки
* неверное определение агента в памяти в FreeBSD
* по умолчанию в l3cd не писалось имя хоста
author devi
date Sun Nov 12 17:34:47 2006 +0200 (2006-11-12)
parents 54fbf2041159
children 3cd466f35ad6
files install l3-agent l3scripts
line diff
     1.1 --- a/install	Fri Aug 04 18:06:09 2006 +0300
     1.2 +++ b/install	Sun Nov 12 17:34:47 2006 +0200
     1.3 @@ -1,5 +1,21 @@
     1.4  #!/bin/sh
     1.5  
     1.6 +hostname=`hostname`
     1.7 +uname -a | grep -qi freebsd || hostname=`hostname -f`
     1.8 +
     1.9 +###############################################################################
    1.10 +#
    1.11 +# Set this variables before installation:
    1.12 +
    1.13 +lilalo_user="YOUR-L3BACKEND-USER"
    1.14 +lab="SET-YOUR-FIRSTLAB-NAME-HERE"
    1.15 +install_l3bashrc_for_this_users="root user"  # users who will use l3agent and l3script
    1.16 +lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
    1.17 +
    1.18 +#
    1.19 +###############################################################################
    1.20 +
    1.21 +
    1.22  lilalo_rc=.l3rc
    1.23  lilalo_home=.lilalo
    1.24  url_lilalo="http://xgu.ru/lilalo"
    1.25 @@ -9,6 +25,7 @@
    1.26  url_perl_modules=${url_lilalo}/
    1.27  perl_modules="Term-VT102 Text-Iconv"
    1.28  
    1.29 +
    1.30  wget=wget
    1.31  uname -a | grep -qi bsd && wget=fetch
    1.32  
    1.33 @@ -17,16 +34,6 @@
    1.34  redC='\033[0;31m'
    1.35  greenC='\033[0;32m'
    1.36  
    1.37 -hostname=`hostname`
    1.38 -uname -a | grep -qi freebsd || hostname=`hostname -f`
    1.39 -
    1.40 -
    1.41 -# Ask this variables:
    1.42 -
    1.43 -lilalo_user="devi"
    1.44 -lab="lilalo-installation"
    1.45 -install_l3bashrc_for_this_users="root ak devi"
    1.46 -lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
    1.47  
    1.48  
    1.49  step()
    1.50 @@ -90,7 +97,7 @@
    1.51      do
    1.52          user_home=`get_user_home "$user"`
    1.53          grep -q l3-agent ${user_home}/.bash_profile 2> /dev/null \
    1.54 -        || { echo >> ${user_home}/.bash_profile ; cat ${user_home}/.bash_profile | sed '1s/^/l3-agent/' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user_home}/.bash_profile; chown -R ${user} ${user_home}/.bash_profile; }
    1.55 +        || { echo >> ${user_home}/.bash_profile ; cat ${user_home}/.bash_profile | sed '1s/^/l3-agentX/' | tr X '\n' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user_home}/.bash_profile; chown -R ${user} ${user_home}/.bash_profile; }
    1.56      done
    1.57  }
    1.58  
     2.1 --- a/l3-agent	Fri Aug 04 18:06:09 2006 +0300
     2.2 +++ b/l3-agent	Sun Nov 12 17:34:47 2006 +0200
     2.3 @@ -866,7 +866,7 @@
     2.4                  unlink $Config{agent_pidfile}
     2.5                      or die "Can't remove stale pidfile ". $Config{agent_pidfile}. " : $!";
     2.6              }
     2.7 -            elsif ($^O eq 'freebsd' && $pid && `ps axo uid,pid,command | grep '$<\\s*$pid\\s*$Config{"l3-agent"}' 2> /dev/null`) {
     2.8 +            elsif ($^O eq 'freebsd' && defined($pid) && $pid ne "" && not `ps axo uid,pid,command | grep '$< $pid $Config{"l3-agent"}' | grep -v grep 2> /dev/null`) {
     2.9                  print "Removing stale pidfile\n";
    2.10                  unlink $Config{agent_pidfile}
    2.11                      or die "Can't remove stale pidfile ". $Config{agent_pidfile}. " : $!";
     3.1 --- a/l3scripts	Fri Aug 04 18:06:09 2006 +0300
     3.2 +++ b/l3scripts	Sun Nov 12 17:34:47 2006 +0200
     3.3 @@ -15,7 +15,7 @@
     3.4  ssh $ssh_user@$host 'grep -q lilalo ~/.bashrc || echo ". ~/.lilalo/l3bashrc && _l3_start" >> ~/.bashrc'
     3.5  ssh $ssh_user@$host 'user=user;grep -q lilalo /home/${user}/.bashrc || echo ". /home/${user}/.lilalo/l3bashrc && _l3_start" >> /home/${user}/.bashrc; chown -R ${user} /home/${user}'
     3.6  ssh $ssh_user@$host 'user=user;grep -q l3-agent ~/.bash_profile || { echo >> ~/.bash_profile ; cat ~/.bash_profile | sed 1s/^/l3-agent\\n/ > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ~/.bash_profile; }'
     3.7 -ssh $ssh_user@$host 'user=user;grep -q l3-agent /home/${user}/.bash_profile || { echo >> /home/${user}/.bash_profile ; cat /home/${user}/.bash_profile | sed 1s/^/l3-agent\\n/ > /tmp/$$$$l3 ; mv /tmp/$$$$l3 /home/${user}/.bash_profile; chown -R ${user} /home/${user}; }'
     3.8 +ssh $ssh_user@$host 'user=user;grep -q l3-agent /home/${user}/.bash_profile || { echo >> /home/${user}/.bash_profile ; cat /home/${user}/.bash_profile | sed 1s/^/l3-agentX/ | tr X "\n" > /tmp/$$$$l3 ; mv /tmp/$$$$l3 /home/${user}/.bash_profile; chown -R ${user} /home/${user}; }'
     3.9  ssh $ssh_user@$host 'cd /tmp; tar xfz Term-VT102*.gz; cd Term-VT102*[^z]; perl Makefile.PL; make ; make install'
    3.10  ssh $ssh_user@$host 'cd /tmp; tar xfz Text-Iconv*.gz; cd Text-Iconv*[^z]; perl Makefile.PL; make ; make install'
    3.11  ssh $ssh_user@$host 'echo l3cd=trainings/$course/$date/$host/root > /root/.l3rc ; echo l3cd=trainings/$course/$date/$host/user > /home/user/.l3rc'