fat thin clients - 030-workstation plug in

Michael Rickmann mrickma at gwdg.de
Tue Apr 8 16:35:43 BST 2008


Hallo everybody,
I am new to this list and relatively new to edubuntu. I am really impressed by 
the capabilities of ltsp5. Since we have a very mixed assortment of 
computers we got interested in creating fat thin clients. With the help of 
David Van Assche's documentation at 
https://help.ubuntu.com/community/UbuntuLTSP/LTSPFatClients we tried to build 
a plugin as outlined in the LTSPFatClients scope at 
https://wiki.edubuntu.org/LTSPFatClients. It really works !!!

I try to attach my script to this mail if it does not work you find it as 
http://wwwuser.gwdg.de/~mrickma/edubuntu/030-workstation.gz .
My script provides a localized and fairly complete setup for Ubuntu / Kubuntu 
desktops with nfs-client capabilitly. It is meant as a starting point for 
integrating a network information service and mounting user homes. Personally 
I use a semi-secured smbldap setup with additional automount maps in ldap. 
But the ldap / nis setups are rather variable, so integrating them into the 
script is not really sensible.

Copy the 030-workstation file to  
usr/share/ltsp/plugins/ltsp-build-client/Ubuntu and call ltsp-build-client 
with the   --workstation dist1[,dist2]   flag, where dist1 and dist2 can be 
Ubuntu or Kubuntu currently. If you wish to have both desktops 
chose --workstation Ubuntu,Kubuntu , the other way around will not work well 
as gnome's fast-user-switch-applet does not like kdm. And !!! chose a mirror 
close to you, it really saves time. This morning i built an image with
ltsp-build-client --arch i386 --chroot gnomek-i386 --mirror 
http://ftp5.gwdg.de/pub/linux/debian/ubuntu/ --workstation Ubuntu,Kubuntu
Then I upgraded by hand and rebuilt using
ltsp-update-image -a gnomek-i386 -p 2003 .
Regards
Michael
-------------- next part --------------
case "$MODE" in
    commandline)
        add_option "workstation" "`eval_gettext "a netbooted diskless workstation mode, e.g --workstation Ubuntu"`" "advanced" "true"
        ;;
    configure)
        if [ -n "$option_workstation_value" ]; then
            TARGETS="Ubuntu Kubuntu"
            for TMP in $(echo $option_workstation_value | tr ',' ' ') ; do
                if [[ $TARGETS == *$TMP* ]]; then
                    if [[ $WORKSTATION != *$TMP* ]]; then
                        WORKSTATION="$WORKSTATION $TMP"
                    fi
                fi
            done
            if [ -z "$WORKSTATION" ]; then
                echo Sorry, $option_workstation_value cannot be installed.
                exit
            fi
            WORKSTATION=$(echo $WORKSTATION)
            RCS_WHITELIST="$RCS_WHITELIST pcmciautils brltty screen urandom udev-finish portmap nfs-common"
            RC2_WHITELIST="$RC2_WHITELIST portmap nfs-common vbesave acpid powernowd.early dbus hal cupsys apport \
                hotkey-setup powernowd consolekit avahi-daemon bluetooth gdm anacron atd cron acpi-support rc.local"
            RC6_WHITELIST="$RC6_WHITELIST portmap"
            RC0_WHITELIST="$RC0_WHITELIST portmap"
            if [[ $WORKSTATION == Ubuntu* ]]; then
                RC2_WHITELIST="$RC2_WHITELIST gdm"
            fi
        fi
        ;;
    after-install)
        if [ -n  "$WORKSTATION" ]; then

            # guess from the LANG environment which localized packages
            # are to be installed, check that they exist
            function add_localized_packages {
                for i in $* ; do
                    for j in $(chroot $ROOT apt-cache -n search $i-$SHORT_LANG | awk '{print $1}') ; do
                        if [ $j == $i-$SHORT_LANG ]; then
                            WORKSTATION_PACKS="$WORKSTATION_PACKS $j"
                        fi
                    done
                done
            }

            # install the right packages for the lowfat Workstation
            #
            # another place for locale
            echo LANG=\"$LANG\" > $ROOT/etc/default/locale
            SHORT_LANG=$(echo $LANG | sed 's/\(.*\)_.*/\1/')
            for WORKSTATION_DESK in $WORKSTATION  ; do
                if [ $WORKSTATION_DESK == Ubuntu ]; then
                    WORKSTATION_PACKS="$WORKSTATION_PACKS ubuntu-desktop language-pack-gnome-en"
                    if [ $SHORT_LANG != en ]; then
                        add_localized_packages language-pack-gnome
                    fi
                fi
                if [ $WORKSTATION_DESK == Kubuntu ]; then
                    WORKSTATION_PACKS="$WORKSTATION_PACKS kubuntu-desktop language-pack-kde-en"
                    if [ $SHORT_LANG != en ]; then
                        add_localized_packages language-pack-kde
                    fi
                fi
            done
            WORKSTATION_PACKS="$WORKSTATION_PACKS language-pack-en language-support-en fdutils fuse-utils ubuntu-standard nfs-common portmap"
            if [ $SHORT_LANG != en ]; then
                add_localized_packages language-pack language-support
            fi
            chroot $ROOT apt-get $APT_GET_OPTS install $WORKSTATION_PACKS
            # remove network-manager it causes trouble
            # and a second login manager
            WORKSTATION_PACKS=network-manager
            if [[ $WORKSTATION == Ubuntu* ]] && [[ $WORKSTATION == *Kubuntu* ]]; then
                WORKSTATION_PACKS="$WORKSTATION_PACKS kdm"
            fi
            if [[ $WORKSTATION == Kubuntu* ]] && [[ $WORKSTATION == *Ubuntu* ]]; then
                WORKSTATION_PACKS="$WORKSTATION_PACKS gdm"
            fi
            chroot $ROOT apt-get $APT_GET_OPTS --purge remove $WORKSTATION_PACKS


            # Now perform local setup similar to main installer
            #
            # fixed in ltsp >= 5.0.40
            cp /etc/timezone $ROOT/etc/timezone
            cp /etc/localtime $ROOT/etc/localtime
            # reserve /home as mountpoint for common user home directories
            # in due consequence move the home for local users somewhere else
            LOCALHOME=/localhome
            mkdir -p $ROOT/$LOCALHOME
            sed -i "s/DHOME *=.*/DHOME=\\$LOCALHOME/" $ROOT/etc/adduser.conf
            echo "
--------------------------------------------------------------
   Please enter a name for the user with admin privileges!
"
            read TMP
            chroot $ROOT adduser --gecos Administrator,,, $TMP
            chmod 600 $ROOT/etc/sudoers
            echo "
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL" >> $ROOT/etc/sudoers
            chmod 440 $ROOT/etc/sudoers
            chroot $ROOT usermod -G admin,adm,dialout,cdrom,floppy,audio,dip,plugdev,scanner,powerdev $TMP


            # get the write-permission for a couple directories and files right for unionfs
            echo 'copy_dirs="$copy_dirs /var/lib/urandom' $LOCALHOME'"' >> $ROOT/etc/default/ltsp-client-setup
            if [[ $WORKSTATION == Ubuntu* ]]; then
                echo 'rw_dirs="$rw_dirs /var/lib/gdm"' >> $ROOT/etc/default/ltsp-client-setup
            fi

            # give the client its dhcpd assigned hostname, you have to add
            # "use-host-decl-names on;" to its group section in /etc/ltsp/dhcpd.conf
            sed -i '/bindfiles=/s/\/etc\/hostname//' $ROOT/etc/default/ltsp-client-setup

            # These cron jobs are not needed if we run them now or have done already
            if [ -e $ROOT/etc/cron.daily/find.notslocate ]; then
                chroot $ROOT /etc/cron.daily/find.notslocate
                rm -f $ROOT/etc/cron.daily/find.notslocate $ROOT/etc/cron.daily/slocate
            fi
            if [ -e $ROOT/etc/cron.daily/man-db ]; then
                chroot $ROOT mandb
                rm -f $ROOT/etc/cron.*/man-db 
            fi
            rm -f $ROOT/etc/cron.*/scrollkeeper
            # large log files
            echo -n "" > $ROOT/var/log/dpkg.log
            echo -n "" > $ROOT/var/log/scrollkeeper.log
        fi
        ;;
    finalization)
        if [ -n  "$WORKSTATION" ]; then
            chroot $ROOT update-rc.d -f laptop-mode remove ; chroot $ROOT update-rc.d laptop-mode start 99 2 3 4 5 . stop 20 0 1 6 .
            if [[ $WORKSTATION == Kubuntu* ]]; then
                # kdm has to be startet after the client has setup X
                chroot $ROOT update-rc.d -f kdm remove ; chroot $ROOT update-rc.d kdm start 30 2 3 4 5 . stop 01 0 1 6 .
                if [[ $WORKSTATION != *Ubuntu* ]]; then
                    chroot $ROOT update-rc.d -f kde-guidance remove ; chroot $ROOT update-rc.d kde-guidance start 89 2 3 4 5 .
                fi
            fi
        fi
esac



More information about the edubuntu-users mailing list