[K12OSN] Mobile Wireless Lab?

Kevin Squire gentgeen at linuxmail.org
Sun Apr 17 04:43:26 UTC 2005


I have a set up here in my house that would be similar/perfect to what
you are mentioning.  Been meaning to write it up, but have not had time.
 So, I guess "here goes nothing".

Laptop is a Thinkpad 380D (133MZ, orig. 32MB ram).  I installed just
enough Debian to get it running X, and ESD (for sound).  No X/K/G-DM,
nothing fancy.  I was NOT planning on using this laptop outside of my
network, I just wanted a "dummy terminal" to use around the house, but
the LTSP wireless floppy would not work with the card I already own.  I
created one user (USERNAME=val) besides the root user.  (If I was doing
this in a "hostile" environment, I would find ways to limit what user
"val" can/can not do.  Basically the only thing she needs is a bash
terminal, and the ability to run X).  For sound to work, I did have to
use sudo and give val permission to run ESD, maybe there was a better
way, but that is what I did :-)

I then followed the directions found here:
http://www.linuxgazette.com/issue72/chung.html

to create an auto-login into console mode.  When val gets automatically
logged in, the ~/.bash_profile script gets read.  Her file looks like
this:

# ~/.bash_profile
## Start X upon console login, logout when X is exited
##
if [ "`tty`" = "/dev/tty1" ] ; then
 exec /home/val/bin/desktop
fi

I probably could have put all of the desktop script into the
~/.bash_profile, but I separated it for troubleshooting reasons.

And the /home/val/bin/desktop script looks like this:

#!/bin/sh
#
# 
echo "Starting X Server to linuxbox ..."

# To kill remnants of ESD from reboots, drops, etc. and start again.
# Not sure why, but paused seemed necessary for success.  echo's are
# just there to let me know it is working :-)
echo "5"; sleep 1 
sudo /usr/bin/pkill esd &
echo "4" ; sleep 1 
sudo /usr/bin/esd &
echo "3" ; sleep 1 ; echo "2" ; sleep 1 ; echo "1" ; sleep 1 ; echo
"GO.." 

# Used to execute XDM on linuxbox
#
echo "starting X"
exec X :0 -query 192.168.0.3

So that take care of the a lot of the LTSP mimicing.  But it does leave
out the LTSP benefit of only having to keep one machine up-to-date.  Now
you still have to worry about keeping 21 machines (20 laptops, plus the
server) up-to-date.  This is where the Debian stuff comes in hand.  

On the laptop, I have a cron job run once a day, to let me know if there
are any packages that need updated.  I have all mail from that machine
(which would include the cron info) to my server machine.  The script
looks like this (I got it off the web, but don't know the address to
give the proper credit) :

#!/bin/bash
#
# Script from web to produce an email whenever system needs updated
# lined added to /etc/crontab to run this at 4:00 AM daily
#
# Update the package cache but don't spit anything out to stdout or #
stderr; that way, if there's nothing to update we won't get a #
pointless mail from cron ...

apt-get update 2>&1 > /dev/null

# Do a "trial" run of updating our packages (note the -s switch). #
apt-get will report something along the lines of ...
#
# n packages upgraded, n newly installed, n to remove and n not upgraded
#
# Strip out the number of packages to upgrade via a bit of grepery and
# awkery ...

report=`apt-get -s upgrade | grep '^[0-9]\{1,\} upgraded'`
if [[ -z "$report" ]]; then
        exit 0          # Move on - there's nothing to do here
fi

to_upgrade=`echo $report | awk -F, '{print $0}' | awk '{print $1}' `
if [[ $to_upgrade -gt 0 ]]; then
      # We've got potential packages to upgrade, spit out our original
      # message from apt-get upgrade to force a mail to be sent for this
      # cron job ...
      echo "$report"
fi

exit 0
  
Then on my server, I have a script called "update_all" that I run
whenever I get a notice from the laptop (and/or from "kingpin" another
Debian box in my house).  With a little help from ssh keys, I do not
need to enter a password for the other boxs, just my server box.  The
script is just:

#!/bin/bash
clear
# Starting with Linuxbox - my desktop/X server
echo "Updating Linuxbox first,"
echo "Need root at linuxbox's password ..."
su -c /root/bin/update-linuxbox
echo " "

# Updating Kingpin - my print/file/anything else server
ssh -p 22 -l root 192.168.0.10 /root/bin/update-local

# Next to Thinkpad - the old laptop 
ssh -p 22 -l root 192.168.0.8 /root/bin/update-local

# System's now complete
echo "House update complete."
echo " "

Where the /root/bin/update-local is just a script with:
   apt-get update && apt-get dist-upgrade

Since you are going to do this on (what I assume to be) 20 identical
machines, I'm sure you can do the install on just one, then ghost the
image to the others.  The cron script would only have to be run on one
of the laptops, since they are all going to be identical.  Then you
won't get 20 "update me" emails at a time.  Then as for the update-all
script, you could write that as a loop with some addtitional "fancies"
added in.  I only have 3 machines to deal with, so my scripts are all
pretty basic/linear.

As an extra note, this has worked really well with my 802.11b network,
and the laptop only having 32MB ram. The "server" is my desktop machine
with a 1GHz processor, and 512MB ram.  The laptop typically is running
IceWM or Blackbox as the WM, but GNOME works at an acceptable pace.  The
laptop is now used by my wife A LOT and I see that she will use it with
Firefox, Thunderbird, GAIM, and Rox-Filer all running at the same time.
With the occational AbiWord, GQview, gxine, or xmms thrown in.  Thanks
to "Uncle Sam" I did max. out the Laptop at 80MB ram, and this really
helped out a lot.


BOY THAT GOT REALLY LONG -- SORRY

Maybe I can get all that put into the wiki, or now take this as my
outline and write up a nice "howto" for the web.  If anyone has any
questions about it, feel free to contact me off list.

Kevin
   gentgeen at linuxmail.org




On Fri, 15 Apr 2005 20:17:53 -0500
Les Mikesell <les at futuresource.com> wrote:

> On Fri, 2005-04-15 at 17:07, Huck wrote:
> > Yeah, I just let it start it's own desktop deal...
> > so if I go runlevel2 it will drop me to command prompt then I can do
> > the x -query server deal and be happy eh?
> 
> Yes, that ends up about the same as a thin client booting from
> the network except that you have access to a lot more drivers
> before you need network access.   I don't think I've tried it
> with anything less than 96M RAM but if you ignore the warning
> about memory when booting it should be OK.
> 
> -- 
>   Les Mikesell
>    les at futuresource.com
> 
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>




More information about the K12OSN mailing list