[Pkg-ltsp-devel] local device support

Oliver Grawert ogra at ubuntu.com
Tue Aug 29 13:00:21 UTC 2006


hi,

local device support for usbdisks/sticks, usb-storage camerase, cdroms
and floppies has landed in ubuntu ! :)))

its a complete remake of the ltsp.org version (we (scott balneaves and
me) only used the ltspfs/ltspfsd as transport layer, but rewrote the
complete integration and messaging stuff)

the changes to the ltsp code itself are minor (10 lines in the
ltsp-client-setup initscript and a small bunch of changes in ldm)

* how it works for us:

on the client:

we have three new binaries running in the client session:

cdpinger - a tool thats monitoring CDROMs, checks for media changes etc
delayed_mounter - a tool that puts the data about devices that were
                  present before login into a tempfile and cares for
                  mounting as soon as a user logged in.
ltspfsd - the original ltspfsd from ltsp.org (with some security fixes)
          which cares for transparent unmounting if there is no traffic
          for 2 seconds and mounts again transparently if there is
          traffic again, so we prevent dataloss since the device itself
          is never mounted if no data is written/read

ldm changes:

- ldm now automatically creates a socket you can attach to if you want
  to run anything in the users session from the client, this socket is
  also used to determine if the user is logged in by the delayed_mounter
  script.

- there is a cleanup call added to the remote_command, to make sure
  everything gets unmounted properly on logout (this should move into a
  server sided ldm/post-session.d in the future)

udev:

- there are some scripts that modify fstab and do the physical mounting
  of the device added to udev and call the ltpsfs mounter in the users 
  session (see /opt/ltsp/$ARCH/etc/udev/rules.d/88-ltsp.rules) through
  the ssh socket.

on the server side:

ltspfs - the fuse client for ltspfsd 
lbmount - suid wrapper to bind mount the ltspfs mounts to /media. the
          bind mounting to media fakes a device at least for the 
          desktops ;)
ltspfsmounter - the script that does the actual mounting 

since ubuntu defaults to gnome an additional bunch of patches has gone
into gnome-vfs2 and nautilus (the desktop now only shows devices a user
can actually access, nautilus has no eject option for devices on thin
clients) and gnome-system-tools (gui patch to users-admin to
enable/disable user access through switching on/off the fuse group)
in the ubuntu packages these are the following patches:

gnome-vfs2: 22_ignore_inaccessible_volumes.patch
nautilus: 95_suppress_umount_in_ltsp.patch
gnome-system-tools: 20_fuse_as_default_group.dpatch

----------
how a localdev session works in short (excluding the more complicated
cdrom and delayed_mounts handling):

the user plugs in a device and udev recieves a kernel event.
if it detects a blockdevice, the udev rules script adds an fstab entry
on the client. after the fstab entry was added, the ltspfsmounter script
is run in the users session (through the ssh socket ldm created)

the ltspfsmounter script initiates a ltspfs/fuse mount of the device
(via the mountpoint thats in the clients fstab)
to /tmp/.$USER-ltspfs/<devicename> on the server and afterwards calls
lbmount to create a bind mount to /media/$USER/<device> for it.

gnome-vfs2 picks up that device and presents it to nautilus (konqueror
and its device handler should do the same (untested yet) for KDE, xfce
in xubuntu uses gnome-vfs2 as well and thunar (their filemanager) will
pick it up as nautilus does.

if there was no traffic for 2secs, the ltspfsd side will unmount the
device to sync the data to the disc while the ltspfs side in the users
session will still present the contents. as soon as a user accesses
anything from the bindmount, the backend will physically mount again.
this way its possible to just unplug devices without any dataloss
(indeed if your filemanager still shows a progress bar unplugging is a
bad idea ;) )

finally if the user logs out, the mountpints get unmounted and the dirs
are removed.
---------

if you want to test it, grab the ltspfs and ltspfsd packages from ubuntu
and try it ;) i'll make two bzr branches available soon and will
announce it here so if you want to contribute changes/fixes just jump on
it ;)

ciao
	oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.alioth.debian.org/pipermail/pkg-ltsp-devel/attachments/20060829/28ccb047/attachment.pgp


More information about the Pkg-ltsp-devel mailing list