Metermaid 0.2.1 - An internet cafe helper

For use with the Linux Terminal Server Project

Written by: Scott Balneaves

Table of Contents:

  1. Requirements
  2. Installing
  3. Using Metermaid
  4. Contact info
  5. TODO

Requirements:

Metermaid shouldn't require anything other than the GDBM libraries.  Most Linux boxes come with GDBM installed, so you should be ok without any further setup.  For other Unices, GDBM is easily downloaded and compiled from http://www.gnu,org

Installing:

First off, you'll need to grab a copy of Metermaid. You can pick it up from this page.

VersionDownload
0.2.1metermaid-0.2.1.tar.gz

Metermaid should be like most GNU software.  After you've untarred it, run the configure script in the usual manner, and make.

./configure
make
make install

Metermaid should put 2 binaries in your /usr/local/bin directory.  The database should go in /usr/local/share/metermaid, and be called metermaid.db The first user you add to the database will create the database.

Using Metermaid:

You'll need to add a few lines to your Session script for whichever session manager you use for your LTSP setup.  An example session script for GDBM would be:

#!/bin/bash

#
# Session script for QVWM
#
PATH=/bin:/usr/bin:/usr/X11R6/bin:\
/usr/local/bin:/usr/local/mozilla:/usr/local/wp8/wpbin

export PATH

#
# Turn on dpms features
#
xset +dpms

#
# Set up root window...
# We'll set a background colour first, then, if the ".currentbackground" link
# exists in the user's home directory, set the background to that.
#

xsetroot -solid "#008080"

if [ -f $HOME/.currentbackground ] ; then
        xsetbg -fullscreen -border "#000000" .currentbackground
fi

#
# Metermaid session tracking
#

if mmuser --login
then
        #
        # Start the window manager
        #
        qvwm
else
        xmessage -geometry 400x200 "You have no more time left."
fi

#
# Done session, so end metermaid tracking
#
mmuser --logout

This now enters the users' session for metermaid management.

You'll also have to add a line to root's crontab.  Here's an example:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/mmadmin --check 5

The parameter to --check is the time delta, i.e. how often, in minutes the check is run.  So, we're running the check in 5 minute intervals.

For each of your users, you'll need to add them to the metermaid database, and give them some time to be able to login with.  You'd do this with:

mmadmin --adduser sbalneav
mmadmin --addtime 30 sbalneav

This creates user sbalneav, and gives the user 30 minutes of login time.

For an internet cafe, one of the nice featurs is that once a user has logged in, and is registered with Metermaid, they can't log in again on another terminal.  As well, if a user trys to get smart and execute "mmuser --logout" on a command line, Metermaid will actually terminate the session for him/her.

If syslog(3) functions are available on your target platform at compile time, Metermaid with log to LOG_AUTHPRIV.  This means all info and error messages should appear (on Redhat systems, anyway) in your /var/log/secure logfile.

Contact Info:

This is a first cut of the software, and as such is pretty rough.  If you have comments or suggestions, please E-mail me at sbalneav@legalaid.mb.ca

TODO: