chadwickh
17th September 2002, 20:21
We have network licensing on three servers as defined in our $BSE/lib/licence6.1 file. To reset licenses I stop the license daemons in reverse order of the licence6.1 file and then start them up in order one at a time. To make this easier, I created a script that reads in the $BSE/lib/licence6.1 file and does this for me. The script is shown below. Now you have to believe me when I say this script used to work. I think a porting set upgrade caused it to not work anymore. Anyway the problem is when I try to issue a remote shell command to run the $BSE/etc/rc.start_licd script the script hangs until I kill the script or kill the license daemon program. My UNIX admins have no idea what could be causing it, do you? If you run the $BSE/etc/rc.start_licd script manually it says it started the license daemon and you can exit your shell cleanly.

Here's the script:

#!/usr/bin/sh
# file: resetlicensedaemons.sh
# auth: Chad Heidema
# date: 01/02/2002
# desc: Resets the license daemons on the servers identified by the $BSE/lib/licence6.1 file
# mods: Added a few lines to be logged to /home/bsp/bsp/license_daemon_reset.log

stop_license_server()
{
if [ "$server" <> " " ]; then
echo `date` "********************************************************"
echo Stopping license server on: $server
echo `date` "********************************************************" >> $logfile
echo $me stopping license server on: $server >> $logfile
remsh $server ps -ef | grep licd6.1 | grep -v grep
remsh $server /home/bsp/bsp/bin/stoplicensedaemon.sh
fi
}

start_license_server()
{
if [ "$server" <> " " ]; then
echo `date` "********************************************************"
echo Starting license server on: $server
echo `date` "********************************************************" >> $logfile
echo $me starting license server on: $server >> $logfile
remsh $server /baan/etc/rc.start_licd
remsh $server ps -ef | grep licd6.1 | grep -v grep
fi
}

# main program here

me=`whoami`
logfile=/home/bsp/bsp/license_daemon_reset.log

# first read the licence file into 3 variables on the current server
host=`hostname`
serverlist=`cat /baan/lib/licence6.1`
echo `date` "********************************************************"
echo "Contents of /baan/lib/license6.1 file on $host: " $serverlist
server1=`echo $serverlist | cut -b-1-6`
server2=`echo $serverlist | cut -b-8-13`
server3=`echo $serverlist | cut -b-15-20`

# now shut down the servers in reverse order from 3 to 1
server=$server3
echo "Stopping first license server: $server3"
stop_license_server
echo "Done stopping first license server"
server=$server2
echo "Stopping second license server: $server2"
stop_license_server
server=$server1
stop_license_server

# now start the servers in order from 1 to 3
server=$server1
start_license_server
server=$server2
start_license_server
server=$server3
start_license_server

patvdv
17th September 2002, 20:53
Chad,

I have seen similar problems before and I think it's partly due to the behaviour of the license daemon itself. The easiest way in which we managed to solve the issue to start your remote script in the background (using '&') so that the remsh finishes immediately.