Restart Baan licd License Daemon

Baan has design flaws in its license scheme. Licenses stay in a used state and can only be freed by restarting the license daemon, licd, there is no way to free a license that is left by a hung session or disconnected session that did not go through the logout. The Baan software uses this "feature" to sell more licenses to ignorant customers.

When using this shell script the sessions are rubbed out and unable to connect for a couple minutes as the licd port connection takes a while to die off. Used on Sun OS. Usually run when no one should be using the system, (i.e., late on a weekend using cron.)

###################### cut here ##########################
#!/bin/ksh
# Restart the licd6.1
#
# Baan has design flaws in its license scheme.  
# Licenses stay in a used state and can only be freed by 
# restarting the license daemon, licd.
# NOTE: run as root


# Check if the Baan licd process exists, and print the pid.
check_licd () {
   test $(ps -ef| grep licd6.1 | grep -v grep | /usr/bin/nawk '{print $2}') &&
   print "PID of licd6.1: " "$(ps -ef| grep licd6.1 | grep -v grep | /usr/bin/nawk '{print $2}')"
}


# Check if the TCP port licd uses is not connected to processes.
check_port () {
   test $(netstat -a | egrep "${LICD_HOST}\.${LICD_PORT} " | wc -l) -ne 0 && return 0
}

###########################################
# Main

export BSE=/apps/baan/bse
export BSE_TMP=/apps/baan/bse/tmp
export LICD_PORT=6003              # Port that the licd uses
export LICD_HOST=hostname          # Host of licd

${BSE}/bin/licmon6.1 -k;           # Kill the licd 

print "Checking ports every 20 seconds..."
while check_port
do
 sleep 20
 print "Number of connections: $(netstat -a | egrep "${LICD_HOST}\.${LICD_PORT} " | wc -l)"

done

print "Start the licd"

${BSE}/bin/licd6.1;
check_no_licd

###################### cut here ##########################

The views and opinions expressed in this page are strictly those of the page author.
The contents of this page have not been reviewed or approved by the University of Minnesota.