Hi All,

Here are my scripts to provide transparent floppy acces to ltsp workstations. 
I wrote the scripts after an ideia from R. Stanford to provide floppy access 
to ltsp workstation using nbd. They are working stable after some testing. 
Users are able to mount and umount local floppy as any other device and  my 
users using KDE do get a correct floppy icone independent of the workstation 
they are sitting at.

If anyone is interest, please try it and let me know if I forget something.

Cicero

Attachment: rc.floppy
Description: application/shellscript

Attachment: mount.sh
Description: application/shellscript

Attachment: umount.sh
Description: application/shellscript

Transparent Floppy Access to LTSP Terminals 
Author: Cicero Mota, [EMAIL PROTECTED] 
date: 21/03/2002
Licence: GNU Software

This document describes a way to provide transparent floppy access to
on a ltsp workstation. Other removable block devices should work as
well (CD, Zip Drive) but is not tested.

The main features are:

1) Users can mount and umount floppy as any other filesystem he
   permission to;

2) Users using a graphical desktop like kde or gnome can have a floppy
   icone that behaves as expected.

HOWTO

1) Install the ltsp_local_apps package. You doesn't need to configure NIS
   if you doesn't need it for another reasons.
2) Include the line

    floppy:x:509:100:/home:/bin/bash
 
    in LTSROOT/etc/passwd and the line 

    users:x:100:

    in LTSROOT/etc/group. Add a user with the same name to your ltsp server.

3) Copy nbd-server, nohup, nice, fuser to LTSROOT/bin and make
   nbd-server setuid and owned by the floppy user.
   copy rc.floppy to /LTSROOT/etc/rc.d/
   copy mount.sh umount.sh to /bin in you ltsp server.
   rename mount and umount to mount.system and umount.system
   link mount.sh to mount and umount.sh to umount.

4) In the [Default] section of lts.conf include the line

    RCFILE_10          = "rc.floppy"
     
4) For each workstation you want to provide floppy access, create a
   network block device  /dev/ltsp/wsname. For example, if you want to
   provide access for workstations named ws01 and ws01

   mkdir /dev/ltsp
   mknod /dev/ltsp/ws01 b 43 1
   mkdno /dev/ltsp/ws02 b 43 2

   Create a directory to hold the mount points. For example

   mkdir /ltspmedia
   mkdir /ltspmedia/ws01
   mkdir /ltspmedia/ws02
   
   Then add 

        FLOPPY = Y

  To the workstation section in lts.conf

5) Include the device you created in your ltspserver fstab. For
   example add

   /dev/ltsp/ws01    /ltspmedia/ws01     auto    noauto,user 0 0
   /dev/ltsp/ws02    /ltspmedia/ws02     auto    noauto,user 0 0

6) Configure you ltspserver to network block devices
   modprobe nbd

7) Allow you users to run fuser under the directory /dev/ltsp/ and run
   rsh as the user floppy. Using sudo add the lines to the
   /etc/sudoers file

   Host_Alias      TERMINALSERVER = 192.168.0.1
   %users  TERMINALSERVER = NOPASSWD: /bin/fuser /dev/ltsp/*
   %users  TERMINALSERVER = (floppy) NOPASSWD: /usr/bin/rsh * *

   It's is done. Your users should be able to mount and umount
   /dev/ltsp/ws0X

8) If you use KDE, your users will get a correct icone for floppy
   any time they log in any workstation you if add the following lines
   to their HOME/.profile file

#### Transparent Floppy icone to ltsp users using KDE 2.2.2
# Author: Cicero Mota, [EMAIL PROTECTED] 
# date: 21/03/2002
# Licence: GNU Software
#

FLOPPY="${HOME}/KDesktop/Floppy Device.desktop"
LNAME=${DISPLAY%:*}

if [ ${LNAME} == localhost ]; then
        printf "[Desktop Entry]\nComment=Mount and browse a floppy 
disc\nDev=/dev/fd0\nFSType=Default\nIcon=3floppy_mount\nMountPoint=/media/floppy\nName=Floppy
 Device\nReadOnly=false\nType=FSDevice\nUnmountIcon=3floppy_unmount" > "${FLOPPY}";
else
SNAME=${LNAME%%.*};
printf "[Desktop Entry]\nComment=Mount and browse a floppy 
disc\nDev=/dev/ltsp/${SNAME}\nFSType=Default\nIcon=3floppy_mount\nMountPoint=/ltspmedia/${SNAME}\nName=Floppy
 Device\nReadOnly=false\nType=FSDevice\nUnmountIcon=3floppy_unmount" > "${FLOPPY}";
fi

unset FLOPPY LNAME SNAME

 






Reply via email to