Archive for the 'linux' Category

A multiple-language kiosk for Linux (Ubuntu Edgy)

Saturday, February 10th, 2007

[This post is a work on progress and may be updated]

Linux is great for one thing: it supports multiple language on the desktop. If you plan to offer a kiosk mode supporting many languages, Linux becomes a good choice.

We settle on Ubuntu Edgy as a default distribution for this setup, but any distribution might do. The chosen environment is Gnome.

Worklog

  1. install Ubuntu.
    we name the administration account ‘administrator’. Pick a secure password.
  2. Add your supported languages (System/Administration/Language Support). I selected English, French and Norwegian. Chose Apply and select your default language
  3. add a guest account
    login ‘guest’, password ‘guest’, real name ‘Mediatheque Guest User’
  4. if you use the GUI, you can limit the privileges. I selected ‘Access external storage…” “Use audio devices” and “Use CD-ROM devices”
  5. change some account options
    • FIXME disable package notifications
    • FIXME restrict menu rights?
  6. configure gdm
    • add a theme with user list, language & logo
    • using gdmsetup, select the theme and restrict the list of users to guest only (one can still log in as administrator, it just won’t show up in the list)
    • trim gdm locales list: reduce /etc/gdm/locale.conf
    • pam for guest users. Create a file called /etc/X11/gdm/nopassusers.txt containing the name of the users that do not require to have a password typed, one user name per line. In our case the file will contain guest. Then modify /etc/pam.d/gdm so that the line auth sufficient pam_listfile.so item=user sense=allow file=/etc/X11/gdm/nopassusers.txt onerr=fail follows auth required pam_env.so

    tip: use gdmthemetester to test; which requires you to install xnest package on Edgy

  7. autologout of the guest account:
    • enable blank screen saver, 10 minutes
    • custom autologout script added to session

    You might want to use the following scripts (add them to /usr/local/bin):

    forcelogout

    #!/bin/bash   # allow close session without user interaction   gconftool-2 --set /apps/gnome-session/options/logout_prompt --type=bool false   # kill session   gnome-screensaver-command --deactivate   gnome-session-save --kill --silent

    screensaveractive

    #!/bin/bash # return 0 if screensaver actif; 1 otherwise output=`( LANGUAGE=en && gnome-screensaver-command --query )` if [[ $output == "The screensaver is active" ]]; then     exit 0 else     exit 1 fi

    autologout

    #!/bin/bash # This script will perform an autologout of the current user  # from a gnome-session when the screensaver is triggered while [ 1 ]; do     sleep 2     screensaveractive && forcelogout && exit done
  8. session
    add firefox, configure home page; change some preferences related to security. Also disable the ‘ask on exit’ element of the session preferences dialog. That will make guest user disconnect easily.
    Also set browser.sessionstore.resume_from_crash to false in about:config as to avoid session restore dialog upon restart (best would be to cleanly shutdown FF in forcelogout, but I don’t know how)
  9. potential security improvements?
    • change menus?
    • remove command line?
    • disable services?
  10. kiosk advertising/documentation. Print out a help document and let it close to the machine
    • help file
    • offer to distribute Linux
    • sell blank CDs/DVDs ?
  11. TODO
  12. improvements
    • session reset
    • localeList widget for gdm ? no flags in gdm to map to a locale (conscious political avoidance decision)…
    • auto-logout for gdm?
    • generic auto logout for X?
    • remove confirm close session?
  13. Interesting links:
    • http://www.justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html

Create an ubuntu package for openwengo using checkinstall and a custom install script

Thursday, July 20th, 2006

openwengo 2.0 is almost out, but there’s still no Debian/ubuntu package for it.

As I don’t want to install it manually on all my machines, I automated the operation to create a debian package.

First we need to write an install script that installs openwengo. I chose to install the wengophone application in /usr/local/lib, so you might want to change that script. You can download the full script with error handling from here.

Here’s a simple version:

cd /tmp
# note of course there's no space between wg and et, but wordpress doesn't let me enter the word...
# See http://forums.asmallorange.com/index.php?s=f9062ac4cefe11274870830330699d58&showtopic=3631&st=0&p=26154&#entry26154
wg et http://download.wengo.com/wengophone/rc/WengoPhone-2.0-rc1-linux-b in-x86.tar.bz2
echo "f67c2c95e5e02776348a966ba9f14dd5  WengoPhone-2.0-rc1-linux-bin-x86.tar.bz2" | md5sum -c -
rm -rf wengo
mkdir wengo
tar -joxf WengoPhone-2.0-rc1-linux-bin-x86.tar.bz2 -C wengo/
chmod -R uog+r /tmp/wengo/wengophone-ng-binary-latest/*
chmod -R u+w /tmp/wengo/wengophone-ng-binary-latest/*
chmod 755 /tmp/wengo/wengophone-ng-binary-latest/*.sh /tmp/wengo/wengophone-ng-binary-latest/qtwengophone
mv /tmp/wengo/wengophone-ng-binary-latest/ /usr/local/lib/wengophone
mkdir -p /usr/local/bin
ln -s /usr/local/lib/wengophone/wengophone.sh /usr/local/bin/wengophone

Now all you have to do is create a debian package using checkinstall.

> sudo checkinstall -D ./install.sh

Answer the questions. My package information ends up like this:

jerome@dolcevita:~$ apt-cache show openwengo
Package: openwengo
Status: install ok installed
Priority: extra
Section: net
Installed-Size: 32
Maintainer: Jerome Lacoste 
Architecture: i386
Version: 2.0-rc1-1
Description: OpenWengo is an multi-platform open source VoIP application that supports the SIP protocol.

The script will auto-download the archive from Wengo’s site, install it and create a .deb file for you to reuse.

update: this method won’t create a package that reuses the shared libraries available in your other repositories (such as gaim ones), so the resulting package will be big. This is a temporary solution until a real package is created.

buildix, the build Linux distribution

Sunday, July 9th, 2006

Pretty cool move by Thoughtworks, bundling svn, trac and CruiseControl together into buildix, a Debian derived distro.

Now what is only missing for me here is a way to handle mailing lists and archive them. But that is easy to add to the distro once installed.

And of course a maven2 repository manager with appropriate permission management for deployment :)