Installation

From BononWiki

Jump to: navigation, search

This construction uses the following:

a. A script (generic.at.script) which adds more functionality to the at daemon.

This script adds for example the ability to make a group of commands run in a specific order in the background.

See: At_extension_scripts


b. Setup to run scripts when a session is started and when ended via PAM.

Required for the setups 0 (workspace mounted in subdirectory of users HOME) and 2 (user gets a totally different chrooted environment aka GoboLinux setup), but also usefull in setup 1, is the running of scripts when a session starts and when it ends.

There are different ways to accomplish this, I'v chosen for a PAM module pam_script, and rewrite that to add extra functionality, like the ability to chroot and unshare the namespace.

Besides the pam_module the onsessionopen and onsessionclose scripts are used, and the directories /etc/session.d/added and /etc/session.d/removed, where the scripts reside which are to be run.

PAM module see: Run_scripts_when_session_starts/ends


c. Automounter setup to identify and mount resources.

Startup:

c0. init script mount.md5key in /etc/rc.d/init.d (with links from various runlevel directories to it) for initialization.

Identify:

c1. local hardware, a rule file in /lib/udev/rules.d to take the right action, specific "launchers" in /lib/udev like mount.md5key.launch.change.cdrom and mount.md5key.launch.add.device, generally to detect changes dynamically
c2. local hardware, various scripts to detect hardware statically, like /etc/mount.md5key/scripts-local/add.device.records
c3. network resources, like SMB shares, scripts using utilities like nbtscan, nmblookup and smbclient, for detection of SMB resources in a dynamic way, programmed as function find_smb_shares in /etc/mount.md5key/md5key.functions
c4. internet resources, like ownCloud, scripts looking for accounts for these services, programmed as function find_internet_services in /etc/mount.md5key/md5key.functions


Automounter:

c5. the key file to match a mountpoint to a fs: /etc/autofs/auto.md5key. This matches every entry to the (nonexistent) filesystem md5key.
c6. the wrapper mount.md5key (typically in /sbin) which is called by the automounter. It checks the (md5) key, and launches the right mount command for it, with the right options.
c7. the scripts to add (and remove) autofs managed mountpoints for an user, typically /etc/session.d/scripts/start/launch_session_automount.sh (/etc/session.d/scripts/stop/end_session_automount.sh).
c8. data in /var/lib/mount.md5key/autofsgroup, containing various information about the different groups and timeouts.
c9. general settings in /etc/mount.md5key/system.directories.conf
c10. general setting in /etc/mount.md5key/md5key.user.defaults.conf
c11. existence of $HOME/.session/mount.md5key

Runtime:

c12. SMB support: cifs support in kernel and various utilties available like mount.cifs, nbtscan, smbclient and nmblookup
c13. SMB support, scripts in /etc/mount.md5key/scripts-remote/smb, to determine the authmethod (guest, credentials or kerberos) and the userid base (local or remote)
c13. special fuse fs to mount an audio cd like fuse-cdfs, see:
c14. special fuse fs to mount ownCloud, like wdfs, see:
c15. special fuse fs to mount Amazon S3, like s3backer, see:

d. the FUSE fs fuse-workspace-ll.

Of course the FUSE fs is required (typically /usr/bin/fuse-workspace-ll), but besides that:

d1. the script to start (and end) the fuse fs, typically /etc/session.d/scripts/start/mount_workspace.sh ( etc/session.d/scripts/stop/umount_workspace.sh) with the right options.
d2. script determine-settings.sh (in /etc/mount.md5key) to determine all the settings for a user, like the various .directory files
d3. script commandfunction.sh (in /etc/mount.md5key) used by the FUSE fs to perform special tasks, like the lookup of resources, or the "eject" of a cdrom.
d4. various layouts (ie basic form of the workspace) in /etc/mount.md5key/layout.
d5. special wrappers like kde_add_iso_mount.sh (in /etc/mount.md5key) which are run from the right click menu in KDE, to add a mountpoint to an iso file.
d6. data in /var/lib/mount.md5key, like the icons and the subtypes used for directories (ie special roles/mimetypes).
d7. manage_workspace.sh, a script which forwards dynamic changes in the workspaces, ie when a USB device is inserted, it creates the various settings and directories to make this USB visible in the workspaces.



Installation

This construction offers two modes:

. the FUSE fs mounted at a subdirectory of the users HOME directory, default $HOME/Workspace.

. the FUSE fs mounted at a system directory (default /var/lib/workspace/$USER/bind) where the system is chrooted to.

The second method requires some additional tools. The most important is libpam_chroot, to make it possible to perform a chroot when a session starts, and exit it again when it ends.



Requirements

Build requirements

To build the FUSE fs of course FUSE is required. I've been using the latest version, 2.8.5 on Linux. I do not know it works on other platforms. I'm using things which are typically Linux, like epoll and inotify.


Runtime requirements


ConsoleKit

To launch scripts when a session starts and when it ends, in different ways, like parralel with the current session (async) or in queue (sync).

Some scripts have to be waited for to finish, like the configuring of the chroot has to be used or not, which depends on the current configuration.

To accomplish that at and some extra scripts are required, which I've called extended.at.script.


At and special script extended.at.script


Udev

To detect hardware changes and launch scripts.


Udisks

To detect changes in removable media like cdroms.


SMB tools like smbclient and nbtscan (or nmblookup).

To detect SMB servers and workgroups nbtscan is preferred. It finds more servers, and is faster. If it is not found, nmblookup is used.

To find all the shares a server provides, smbclient is used.


Chroot

To perform the chroot when a session starts, there is a nice PAM module which exactly does that. It's easy to configure. Note this is only required when using the system chroot mode, not when mounting at a subdirectory of the users homedirectory.


Mounting

To do the mounting autofs is used. No special requirements to the version, I'm using a very simple setup. All the intelligence when it comes to mounting is in the mount utility - provided by this construction - mount.md5key.


Filesystems supported when found:


ntfs (using another fuse fs ): ntfs-3g

SMB shares: mount.cifs (and fs cifs enabled in kernel)

Audio CD's (using another fuse fs): cddfs


I'm planning to add support for:

Google Docs (using another fuse fs): google-docs-fs

Amazon S3 (using another fuse fs): s3backer



Get the source

First of all the FUSE fs fuse-workspace-ll.

... something howto get it ..... gitorious ... update it there first

or extract archive:

... tar -xvf archive

cd fuse-workspace-ll make

mv fuse-workspace-ll /usr/bin

Personal tools