Was this page helpful?

Dynamic Host

Table of contents
No headers

FireSignal needs to know the IP of the machine where its services are running. Unfortunately sometimes a host changes its IP and doesn't have a static name registered in a DNS. This can be solved either by using the localhost as the hostname for FireSignal, which will only allow to use FireSignal on the local machine. The following solution updates all the FireSignal scripts with the IP of the machine at boot time:

IFCFG=eth1
FSIGNAL_WEB_DIR=/var/www/html/
FSIGNAL_SERVER_LOC=/opt/firesignal-1.1/

FSIGNAL_HOST=`ifconfig $IFCFG | grep "inet addr" | cut -d ":" -f2 | cut -d " " -f1`
for i in `find $FSIGNAL_WEB_DIR -name '*.jnlp'`; do sed -i -e "s/http:\/\/[a-zA-Z0-9._$]*/http:\/\/$FSIGNAL_HOST/g" -e "s/corbaloc:iiop:1.2@[a-zA-Z0-9._$]*/corbaloc:iiop:1.2@$FSIGNAL_HOST/g" $i; done
for i in `find $FSIGNAL_WEB_DIR -name '*.xml'`; do sed -i -e "s/<server>[a-zA-Z0-9._$]*/<server>$FSIGNAL_HOST/g" -e "s/@[a-zA-Z0-9._$]*/@$FSIGNAL_HOST/g" $i; done
sed -i -e "s/name=\"firesignal.sdas.server.url\" value=\"[a-zA-Z0-9._$]*/name=\"firesignal.sdas.server.url\" value=\"$FSIGNAL_HOST/g" $FSIGNAL_WEB_DIR/jws/FireSignalClient.jnlp

for i in `find $FSIGNAL_SERVER_LOC -name '*Script*'`; do sed -i -e "s/1.2@[a-zA-Z0-9._]*/1.2@$FSIGNAL_HOST/g" -e "s/\bHOST=[a-zA-Z0-9._]*/HOST=$FSIGNAL_HOST/g" -e "s/-ORBInitialHost [^$][a-zA-Z0-9._]*/-ORBInitialHost $FSIGNAL_HOST/g" $i; done

Please notice that you have to change IFCFG, FSIGNAL_WEB_DIR and FSIGNAL_SERVER_LOC accordingly. The best way to proceed is to save this script in a file (for instance /etc/fsignalDynHost) and to run it at boot time by placing it in the local start service (/etc/conf.d/local.start or /etc/rc.local).

Was this page helpful?
Tag page (Edit tags)
  • No tags
You must login to post a comment.
Powered by MindTouch Core