running flexlm when only a windows vendor daemon is supplied

  • start aptitude, select wine-bin but deselect dbus and xml-core (unfortunately, this pulls in all the X11 deps – argh!)
  • mkdir /opt/flexlm/rockwell/wine && chown flexlm /opt/flexlm/rockwell/wine
  • run the init script once – it'll start the license server and create a wine bottle, then stop it
  • chown -R root:root /opt/flexlm/rockwell/wine && chown flexlm /opt/flexlm/rockwell/wine && chmod 555 /opt/flexlm/rockwell/wine && chown flexlm "/opt/flexlm/rockwell/wine/drive_c/windows/profiles/All Users/Application Data/Macrovision/FLEXlm" && rm "/opt/flexlm/rockwell/wine/drive_c/windows/profiles/All Users/Application Data/Macrovision/FLEXlm/*"
  • also edit /opt/flexlm/rockwell/wine/system.reg and change Start to 3 (on demand) for the MountMgr service
  • /etc/init.d/flexlm-rockwell:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          flexlm-rockwell
# 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 Rockwell FlexLM server (via. Wine).
### END INIT INFO

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

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DAEMON=/opt/flexlm/rockwell/lmgrd.exe
DAEMON_OPTS="-c Z:\\opt\\flexlm\\rockwell\\licenses\\license.dat -l +Z:\\var\\log\\flexlm\\rockwell.log -local"
NAME=flexlm-rockwell
DESC="FlexLM server"
SCRIPTNAME=/etc/init.d/$NAME
USER=flexlm

WINE=/usr/bin/wine
WINEPREFIX=/opt/flexlm/rockwell/wine ; export WINEPREFIX
VENDOR=flexsvr.exe

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 $WINE -- $DAEMON $DAEMON_OPTS 2> /dev/null
        then
            log_end_msg 1
        else
            log_end_msg 0
        fi
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" $NAME
        if start-stop-daemon --quiet --stop --oknodo --retry 30 --oknodo \
            --exec $DAEMON
        then
            test ! -z `pidof $DAEMON` && kill `pidof $DAEMON` 
            test ! -z `pidof $VENDOR` && kill `pidof $VENDOR`
            test -e $WINEPREFIX/drive_c/windows/profiles/All\ Users/Application\ Data/Macrovision/FLEXlm/* && rm $WINEPREFIX/drive_c/windows/profiles/All\ Users/Application\ Data/Macrovision/FLEXlm/*
            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/windows_flexlm_on_linux_via_wine.txt · Last modified: 2010/05/03 21:39 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS