This is an old revision of the document!


This depends on some particular (weird) files and their special attributes (using user_xattr) – we create a freeze-dried filesystem image and then keep refreshing it on every reboot.

  • init script to mount and refresh filesystem – /etc/init.d/everlockfs:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          everlockfs
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# X-Start-Before:    samba
# X-Stop-After:      samba
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Restore and mount the everlock FS.
### END INIT INFO

# Author: Tom Dobes <tomdobes@purdue.edu>

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=everlockfs
DESC="Everlock FS"
SCRIPTNAME=/etc/init.d/$NAME
FS=/opt/everlock/everlockfs.ext2
FSTYPE=ext2
FSOPTS=loop,user_xattr
MOUNTPOINT=/opt/everlock/fs

set -e

. /lib/lsb/init-functions

case "$1" in
    start)
        log_daemon_msg "Starting $DESC" $NAME
        if test -z "`mount | grep "$FS.mounted"`" && cp $FS $FS.mounted && mount -t $FSTYPE $FS.mounted $MOUNTPOINT -o $FSOPTS
        then
            log_end_msg 0
        else
            log_end_msg 1
        fi
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" $NAME
        if umount -f $FS.mounted && rm $FS.mounted
        then
            log_end_msg 0
        else
            log_end_msg 1
        fi
        ;;
    restart|force-reload)
        $0 stop
        sleep 5
        $0 start
        ;;
    *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
  • /etc/samba/smb.conf:
TODO
  • add an everlock user (uid 103)
computer/everlock_licenses_with_samba.1272944313.txt.gz · Last modified: 2010/05/03 22:38 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS