# HG changeset patch # User devi # Date 1163345687 -7200 # Node ID 0d49f33696b38729878e161e82135436c4f71910 # Parent 54fbf2041159356b3f2d4f3c9ace7e3e95cb0128 Исправлены ошибки: * инсталляция агента в .bash_profile - была проблема с переводом строки * неверное определение агента в памяти в FreeBSD * по умолчанию в l3cd не писалось имя хоста diff -r 54fbf2041159 -r 0d49f33696b3 install --- a/install Fri Aug 04 18:06:09 2006 +0300 +++ b/install Sun Nov 12 17:34:47 2006 +0200 @@ -1,5 +1,21 @@ #!/bin/sh +hostname=`hostname` +uname -a | grep -qi freebsd || hostname=`hostname -f` + +############################################################################### +# +# Set this variables before installation: + +lilalo_user="YOUR-L3BACKEND-USER" +lab="SET-YOUR-FIRSTLAB-NAME-HERE" +install_l3bashrc_for_this_users="root user" # users who will use l3agent and l3script +lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" + +# +############################################################################### + + lilalo_rc=.l3rc lilalo_home=.lilalo url_lilalo="http://xgu.ru/lilalo" @@ -9,6 +25,7 @@ url_perl_modules=${url_lilalo}/ perl_modules="Term-VT102 Text-Iconv" + wget=wget uname -a | grep -qi bsd && wget=fetch @@ -17,16 +34,6 @@ redC='\033[0;31m' greenC='\033[0;32m' -hostname=`hostname` -uname -a | grep -qi freebsd || hostname=`hostname -f` - - -# Ask this variables: - -lilalo_user="devi" -lab="lilalo-installation" -install_l3bashrc_for_this_users="root ak devi" -lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" step() @@ -90,7 +97,7 @@ do user_home=`get_user_home "$user"` grep -q l3-agent ${user_home}/.bash_profile 2> /dev/null \ - || { 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; } + || { 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; } done } diff -r 54fbf2041159 -r 0d49f33696b3 l3-agent --- a/l3-agent Fri Aug 04 18:06:09 2006 +0300 +++ b/l3-agent Sun Nov 12 17:34:47 2006 +0200 @@ -866,7 +866,7 @@ unlink $Config{agent_pidfile} or die "Can't remove stale pidfile ". $Config{agent_pidfile}. " : $!"; } - elsif ($^O eq 'freebsd' && $pid && `ps axo uid,pid,command | grep '$<\\s*$pid\\s*$Config{"l3-agent"}' 2> /dev/null`) { + 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`) { print "Removing stale pidfile\n"; unlink $Config{agent_pidfile} or die "Can't remove stale pidfile ". $Config{agent_pidfile}. " : $!"; diff -r 54fbf2041159 -r 0d49f33696b3 l3scripts --- a/l3scripts Fri Aug 04 18:06:09 2006 +0300 +++ b/l3scripts Sun Nov 12 17:34:47 2006 +0200 @@ -15,7 +15,7 @@ ssh $ssh_user@$host 'grep -q lilalo ~/.bashrc || echo ". ~/.lilalo/l3bashrc && _l3_start" >> ~/.bashrc' 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}' 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; }' -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}; }' +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}; }' ssh $ssh_user@$host 'cd /tmp; tar xfz Term-VT102*.gz; cd Term-VT102*[^z]; perl Makefile.PL; make ; make install' ssh $ssh_user@$host 'cd /tmp; tar xfz Text-Iconv*.gz; cd Text-Iconv*[^z]; perl Makefile.PL; make ; make install' ssh $ssh_user@$host 'echo l3cd=trainings/$course/$date/$host/root > /root/.l3rc ; echo l3cd=trainings/$course/$date/$host/user > /home/user/.l3rc'