LTSP Kiosk
Introduction

Basic Setup
Server-side Changes
Client-side Changes
Adding New Clients

Additional Features
Locking FireFox
PDF Support
Background Image
Printing

Advanced Issues
Securing Connection
Client Firewall
Detect Kiosk Idle
Booting Clients Remotely

Tailored Tools

Booting Clients from Server

Theory of Operation

In some cases you want to force clients to boot. If you make changes to xinitrc this is not needed, since it will be re-read whenever the user logs out (closes the browser). However, there are occasions when more rough methods are needed, like after updating the client kernel in TFTP directory.

To achieve this I wrote a small daemon called bootmed (boot-me-daemon). The rationale behind the tool is following:

  1. When the computer boots it creates a so-called my-file to /tmp, like /tmp/bootmed.me. The change time of the file is later on used as a reference.
  2. When executed bootmed compares the key file, like /etc/bootmed.key. If the key file is newer than the my-file, the bootmed executes a script specified by the -e switch. When you want to boot clients, you touch the key-file in the server.
  3. The external script takes care of the booting.

When using this tool you might want to consider following:

  • For operation it is essential that the server's and client's clocks are synchronised, so you should set a ntp-server-client setting.

Installation Steps

NTP

  1. Enable NTP in your kiosk server. Make sure the client's reach the server port 123 (TCP & UDP) which are used by the NTP protocol.
  2. Install ntpdate to client's /usr/bin. In my case the /lib/libcap.so.1 was also required.
  3. Add new boot-time script ntpdate. Here is mine:

    . /etc/ltsp_functions

    SERVER=`get_cfg SERVER none`

    if [ "$SERVER" != "none" ]; then
    /usr/sbin/ntpdate $SERVER
    fi

    echo "this file was created by /etc/rc.d/ntpdate" >/tmp/bootmed.me


    This script gets the current time from the kiosk server and creates the /tmp/bootmed.me file that is later on used as a timestamp for the client's boot time. Make sure the rc.d/ntpdate is executable by the root.
     
  4. Edit your lts.conf to instruct the boot script to execute the script at the boot time:

    RCFILE_0X = ntpdate

    Note: X refers to next free number.
     
  5. In the server's effective timezone differs from GMT, you have to make the clients to use the same tz. To achieve this copy the server's /etc/localtime (a binary file) to client's /etc/localtime. Don't forget to update whenever changing the server's timezone.

Boot-Me-Daemon

  1. Get and compile bootmed (see the front page of the site).
  2. Install bootmed to client's /usr/bin
  3. Install qreboot to client's /usr/sbin and make it suid-root (chmod u+s qreboot). The suid-bit is needed since without it the normal user can not boot the machine.

Add reboot script (e.g. /etc/xinitrc.reboot)

The reboot daemon can point directly to qreboot executable, but you can also write a short script in case you want to add some functionality to the reboot process. This small script casts a short notice to the screen using gtk_popup, waits for 10 seconds and then reboots the client.

#!/bin/sh

cat /usr/local/timeout_popup/reboot.txt | gtk_popup &
sleep 10
/usr/sbin/qreboot

Edit Your /etc/xinitrc

This step can not be covered in a great detail as it depends on your xinitrc. You have to run the bootmed at the stages you wish to check whether the client should be booted or not. If you want the bootmed to constantly monitor the server's key file you run it without the -s switch. In case you want to check the boot need for example before executing the browser you use the -s.

Example 1: daemon

# Turn bootmed on
/usr/bin/bootmed -m /tmp/bootmed.me -k /etc/bootmed.key \
	-e /etc/xinitrc.reboot -p $HOME/bootmed.pid

# Authentication
USERNAME=`/usr/bin/kiosk_login`

# Turn bootmed off
kill -TERM `cat $HOME/bootmed.pid`
rm $HOME/bootmed.pid

Example 2: single pass

# Check for need to reboot
/usr/bin/bootmed -s -m /tmp/bootmed.me -k /etc/bootmed.key -e /etc/xinitrc.reboot

How to Force Boot on Clients

In the examples above the key file indicating the time stamp of the boot order is located at client's /etc/bootmed.key. When you want to issue a boot request at the server you simply touch the file:

touch /opt/lts/i386/etc/bootmed.key

or wherever your client's /etc is located.

Further Ideas

This solution can also be used to turn the power off from the clients e.g. for the night or weekend. For this you have to have separate key files (e.g. /etc/bootmed.reboot.key and /etc/bootmed.poweroff.key) and run separate bootmed processes to monitor these files and run the corresponding executable.

Updated: 9-MAR-2004