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:
[global]
workgroup = ems
wins server = pcdc1.calumet.purdue.edu
server string = ECE/ECET License Server
security = share
preferred master = no
dns proxy = no
name resolve order = wins host
lm announce = no

# disable printing
load printers = no
show add printer wizard = no
disable spoolss = yes

# logfile settings
log file = /var/log/samba/log.%m
max log size = 50
syslog = 0
panic action = /usr/share/samba/panic-action %d

# drop connections with no open files after 15 minutes of inactivity
deadtime = 15

[everlock$]
comment = Everlock Licenses
path = /opt/everlock/fs/everlock
browseable = no
writable = yes
force user = everlock
force group = nogroup
guest ok = yes
store dos attributes = yes
  • add an everlock user (uid 103)
computer/everlock_licenses_with_samba.txt · Last modified: 2010/05/03 22:59 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS