There's a linux build of the sentinel drivers, but it requires a custom kernel module with a binary blob. Yuck. Also, it seems to have a problematic build file for modern kernels. There's also some uncertainty as to whether it would even work with an ancient parallel dongle like ours. (apparently there were different generations of parallel dongles… and the newer software seems to be more more based on usb dongles anyway) So… instead we'll run the Windows server under Wine. Amazingly, that's actually easier.

  • aptitude install wine-bin, but deselect dbus, dbus-x11, and xml-core
  • echo ppdev >> /etc/modules
  • in winecfg – make sure to configure wine to run as win98 – this is necessary for parallel port access, remove Z drive and D drive
  • add keys to HKCU to configure parallel port 378 to point to /dev/parport0 – http://wiki.jswindle.com/index.php/Wine_Registry#Ports http://wiki.winehq.org/UsefulRegistryKeys?highlight=(parport)
  • install rnbosent drivers for win98 (this will add a vxd)
  • to test using GUI app: wine NSRVGX.EXE /SN:0 /SW:0 /N:emslicense /TI:1 /RI:1
  • do not use the /DN parameter – it makes visualnastran unable to see the server
  • the server uses TCP Port 2051 and UDP Port 2050
  • you have to manually copy NSSRVICE.EXE to system32, then run the install command
  • NSSRVICE.EXE /I /SN:0 /SW:0 /N:emslicense /TI:1 /RI:1 will install it
  • to start it, run wineserver -p && wineboot 2> /dev/null
  • to stop it, run wineserver -k
  • you might want to configure the mount daemon to not start automatically to save RAM (change start from 2 to 3 in the registry)
  • testing:
su -c "/usr/lib/wine/wineserver -p" -s /bin/sh netsentinel
su -c "/usr/bin/wineboot" -s /bin/sh netsentinel
su -c "/usr/lib/wine/wineserver -k" -s /bin/sh netsentinel
  • the netsentinel user needs to own /dev/parport0… to do this, I created a /etc/udev/rules.d/55-sentinel.rules:
SUBSYSTEM=="ppdev", OWNER="netsentinel"
  • the netsentinel user needs to own /opt/netsentinel/.wine – but does not necessarily need write permissions. I did this: chown -R root:root /opt/netsentinel/.wine && chown netsentinel /opt/netsentinel/.wine && chmod 555 /opt/netsentinel/.wine
  • /etc/init.d/netsentinel looks like this:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          netsentinel
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the NetSentinel server.
### END INIT INFO

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

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DAEMON=/usr/lib/wine/wineserver
DAEMON2=/usr/bin/wineboot
DAEMON_OPTS="-p"
NAME=netsentinel
DESC="NetSentinel server"
SCRIPTNAME=/etc/init.d/$NAME
USER=netsentinel

test -x $DAEMON || exit 0

set -e

. /lib/lsb/init-functions

case "$1" in
    start)
        log_daemon_msg "Starting $DESC" $NAME
        if ! start-stop-daemon --start --quiet --oknodo \
            --chuid $USER --exec $DAEMON -- $DAEMON_OPTS 2> /dev/null
        then
            log_end_msg 1
        else
            if ! start-stop-daemon --start --quiet --oknodo \
                --chuid $USER --exec $DAEMON2 2> /dev/null
            then
                log_end_msg 1
            else
                log_end_msg 0
            fi
        fi
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" $NAME
        if start-stop-daemon --quiet --stop --oknodo --retry 30 --oknodo \
            --user $USER --signal INT --exec $DAEMON
        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
computer/netsentinel_license_server_under_wine.txt · Last modified: 2010/05/03 04:54 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS