notes on install:

  • make a flexlm user (uid 102 or so)… homedir /nonexistent and shell /bin/false
  • files in /opt/flexlm:
    • /opt/flexlm/fluent/ - contains lmgrd, lmutil, FluentLm (or other vendor daemon)
    • /opt/flexlm/licenses/ - contains 2010-01.lic and license.dat (symlink to 2010-01.lic)
    • for ANSYS only: /opt/flexlm/ansys/ also contains ansysli_monitor, ansysli_server, ansysli_util, ansyslmd.ini, license.dat (symlink to licenses/license.dat)
    • for ANSYS only: /opt/flexlm/ansys/language/en-us/ contains ansysli_msgs.xml
    • for ANSYS only: /opt/flexlm/ansys/prodord/ contains ansysli.prodord.xml
  • for Cadence and Maple 14: ln -sf ld-linux.so.2 /lib/ld-lsb.so.3
  • flexlm expects /usr/tmp – ln -s /tmp /usr/tmp
  • mkdir /var/log/flexlm && chown flexlm:adm /var/log/flexlm && chmod 750 /var/log/flexlm
  • /etc/init.d/flexlm-fluent looks like this:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          flexlm-fluent
# 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 Fluent FlexLM server.
### END INIT INFO

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

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

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
        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
            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/init.d/flexlm-ansys looks like this:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          flexlm-ansys
# 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 ANSYS FlexLM server.
### END INIT INFO

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

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DAEMON=/opt/flexlm/ansys/ansysli_server
DAEMON_OPTS="-c /opt/flexlm/ansys/licenses/license.dat -log /var/log/flexlm/ansysli.log -logappend -l +/var/log/flexlm/ansys.log -local"
NAME=flexlm-ansys
DESC="FlexLM server"
SCRIPTNAME=/etc/init.d/$NAME
USER=flexlm

ANSYSLIC_DIR="/opt/flexlm/ansys"; export ANSYSLIC_DIR

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
        then
            log_end_msg 1
        else
            log_end_msg 0
        fi
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" $NAME
        if $DAEMON -k stop
        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
  • apparently the device with the MAC address matching the license files MUST be eth0 – you can switch that around through /etc/udev/rules.d/70-persistent-net.rules and /etc/network/interfaces
    • /etc/udev/rules.d/70-persistent-net.rules:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ae:3f:88:d8:ba:03", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:84:0b:ed:00", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
  • /etc/network/interfaces:
allow-hotplug eth0
iface eth0 inet manual
	pre-up ifconfig $IFACE up
	pre-down ifconfig $IFACE down

allow-hotplug eth1
iface eth1 inet static
	address 205.215.68.128
	netmask 255.255.255.0
	gateway 205.215.68.254
  • update-rc.d flexlm-fluent defaults
  • pin the licenses to a particular combination of ports… in the license file, add a port number after the MAC address to change the lmgrd port, and add port=X after the vendor daemon to change its port… These are just the TCP ports. Some of the vendor daemons listen on UDP ports too, but those don't appear to be necessary so I'm leaving them firewalled. One exception is ANSYS: Clients need to be able to access the ansysli port and the lmgrd port, but NOT the ansyslmd port. (ansysli talks to this one to proxy requests, so it's just there for loopback connections)
  • FlexLM has a tendency to leave a bunch of FIN_WAIT1 connections lying around after a while… possibly as a result of clients dropping off without closing the connection properly. We can work around this by adding these lines to /etc/sysctl.conf:
# closes a bunch of FIN_WAIT1 connections from flexlm
net.ipv4.tcp_orphan_retries = 2
  • Maple 14 side-by-side with Maple 13 – The Maple people did something truly infuriating when they broke backwards-compatibility with their new license daemon in Maple 14. We can't run multiple vendor daemons with the same name on the same system because they store lock files in /var/tmp … but we can work around this with a chroot
    • put the old license daemon in /opt/flexlm/maple/v13 (the new license daemon will live in the maple directory)
    • make sure the new license file uses a different set of ports; add those ports to ufw
    • mv /opt/flexlm/maple/licenses/license.dat /opt/flexlm/maple/licenses/license-v13.dat … we'll put a symlink to the NEW license file at license.dat
    • mv /var/log/flexlm/maple.log /var/log/flexlm/maple-v13.log
    • make the chroot: mkdir /opt/flexlm/maple/v13/chroot && cd /opt/flexlm/maple/v13/chroot && mkdir bin dev etc lib opt proc sys tmp usr var var/tmp var/log && chmod 777 var/tmp && chmod +t var/log
    • edit /etc/init.d/flexlm-maple as follows:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          flexlm-maple
# 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 Maple FlexLM server.
### END INIT INFO

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

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DAEMON=/opt/flexlm/maple/lmgrd
DAEMON13=/opt/flexlm/maple/v13/lmgrd
DAEMON_OPTS="-c /opt/flexlm/maple/licenses/license.dat -l +/var/log/flexlm/maple.log -local"
DAEMON_OPTS13="-c /opt/flexlm/maple/licenses/license-v13.dat -l +/var/log/flexlm/maple-v13.log -local"
MAPLE13CHROOT=/opt/flexlm/maple/v13/chroot
NAME=flexlm-maple
DESC="FlexLM server"
SCRIPTNAME=/etc/init.d/$NAME
USER=flexlm

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
        then
            log_end_msg 1
        else
            mount -o bind /bin $MAPLE13CHROOT/bin
            mount -o bind /dev $MAPLE13CHROOT/dev
            mount -o bind /etc $MAPLE13CHROOT/etc
            mount -o bind /lib $MAPLE13CHROOT/lib
            mount -o bind /opt $MAPLE13CHROOT/opt
            mount -o bind /proc $MAPLE13CHROOT/proc
            mount -o bind /sys $MAPLE13CHROOT/sys
            mount -o bind /tmp $MAPLE13CHROOT/tmp
            mount -o bind /usr $MAPLE13CHROOT/usr
            mount -o bind /var/log $MAPLE13CHROOT/var/log
            if ! start-stop-daemon --start --quiet --oknodo \
                --chuid $USER --chroot $MAPLE13CHROOT \
                --exec $DAEMON13 -- $DAEMON_OPTS13
            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 \
            --exec $DAEMON
        then
            if start-stop-daemon --quiet --stop --oknodo --retry 30 --oknodo \
                --exec $DAEMON13
            then
                umount $MAPLE13CHROOT/bin
                umount $MAPLE13CHROOT/dev
                umount $MAPLE13CHROOT/etc
                umount $MAPLE13CHROOT/lib
                umount $MAPLE13CHROOT/opt
                umount $MAPLE13CHROOT/proc
                umount $MAPLE13CHROOT/sys
                umount $MAPLE13CHROOT/tmp
                umount $MAPLE13CHROOT/usr
                umount $MAPLE13CHROOT/var/log
                log_end_msg 0
            else
                log_end_msg 1
            fi
        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/linux_flexlm_setup.txt · Last modified: 2011/01/14 20:40 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS