From 00eafe4e3f8b24dc55c81040c6da5ff0f787f43d Mon Sep 17 00:00:00 2001 From: zimoch Date: Wed, 28 Jun 2017 08:46:31 +0000 Subject: [PATCH] setup EPICS_CA_ADDR_LIST depending on network --- startup.script_linux | 47 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/startup.script_linux b/startup.script_linux index cc3adcb..60eb849 100644 --- a/startup.script_linux +++ b/startup.script_linux @@ -1,14 +1,47 @@ -# $Source: /cvs/A/CS/startup/startup.script_linux,v $ +# set EPICS according to BASE or default to 3.14.12 +epicsEnvSet EPICS, R$(BASE=3.14.12) -# set EPICS according to BASE or default to 3.14.8 -epicsEnvSet EPICS, R3.14.8 -epicsEnvSet EPICS, R$(BASE) +# set up CA search lists for different networks +# Office (only officicial EPICS subnets, not SLS beamlines!) +epicsEnvSet CA_129.129.130,"129.129.131.255 129.129.137.255" +epicsEnvSet CA_129.129.131,"129.129.130.255 129.129.137.255" +epicsEnvSet CA_129.129.137,"129.129.130.255 129.129.131.255" + +# WHLA (FIN machine networks) +epicsEnvSet CA_172.21.10,"172.21.11.255 172.21.12.255 172.21.13.255" +epicsEnvSet CA_172.21.11,"172.21.10.255 172.21.12.255 172.21.13.255" +epicsEnvSet CA_172.21.12,"172.21.10.255 172.21.11.255 172.21.13.255" +epicsEnvSet CA_172.21.13,"172.21.10.255 172.21.11.255 172.21.12.255" + +# OSFA (SF machine networks) +# with name servers +#epicsEnvSet CA_172.26,"sf-cans-01 sf-cans-02" +#epicsEnvSet CA_AUTO_172.26,"NO" +#epicsEnvSet CA_BEACON_172.26,"172.26.0.255 172.26.2.255 172.26.8.255 172.26.16.255 172.26.24.255 172.26.32.255 172.26.40.255 172.26.110.255 172.26.111.255 172.26.120.255" +#epicsEnvSet CA_AUTO_BEACON_172.26,"NO" +# with directed broadcasts +epicsEnvSet CA_172.26,"172.26.0.255 172.26.2.255 172.26.8.255 172.26.16.255 172.26.24.255 172.26.32.255 172.26.40.255 172.26.110.255 172.26.111.255 172.26.120.255" +epicsEnvSet CA_AUTO_172.26,"NO" + +# All others can work with the defaults: automatic + +# Apply settings dependent on network +system ("/sbin/ifconfig | awk -F '[.: ]+' -v P='epicsEnvSet NET' -v K=, '/192.168/ {next} /Bcast/ {print P 1 K $9; print P 2 K $10; print P 3 K $11; exit}'>/tmp/$(IOC).net") +< /tmp/$(IOC).net +system ("rm /tmp/$(IOC).net") +epicsEnvSet EPICS_CA_ADDR_LIST,"$(CA_$(NET1=).$(NET2=).$(NET3=)=$(CA_$(NET1=).$(NET2=)=))" +epicsEnvSet EPICS_CA_AUTO_ADDR_LIST,"$(CA_AUTO_$(NET1=).$(NET2=).$(NET3=)=$(CA_AUTO_$(NET1=).$(NET2=)=YES))" +epicsEnvSet EPICS_CAS_BEACON_ADDR_LIST,"$(CA_BEACON_$(NET1=).$(NET2=).$(NET3=)=$(CA_BEACON_$(NET1=).$(NET2=)=$(EPICS_CA_ADDR_LIST)))" +epicsEnvSet EPICS_CAS_BEACON_AUTO_ADDR_LIST,"$(CA_AUTO_BEACON_$(NET1=).$(NET2=).$(NET3=)=$(CA_AUTO_BEACON_$(NET1=).$(NET2=)=$(EPICS_CA_AUTO_ADDR_LIST)))" + +# set some search paths +epicsEnvSet EPICS_DRIVER_PATH "bin/R$(EPICS_RELEASE)_$(EPICS_HOST_ARCH):bin:snl:$(EPICS_MODULES=/ioc/modules):$(INSTBASE)/iocBoot/R$(EPICS_RELEASE)/$(EPICS_HOST_ARCH)" epicsEnvSet TEMPLATES, $(INSTBASE)/iocBoot/templates epicsEnvSet CFG, $(PWD)/cfg epicsEnvSet STREAM_PROTOCOL_PATH, .:$(PWD)/cfg -epicsEnvSet gpasciiCommander, $(INSTBASE)/iocBoot/startup/gpasciiCommander$(GPASCII_VERSION=) -require sysmon +# IOC monitoring +require iocStats $(iocStats_VERSION=) -! iocBootNotify.sh $(IOC) - \${SHELLBOX#*:} - $(_) $(PWD)/startup.script - $(EPICS) - +! iocBootNotify.sh $(IOC) - \"\${SHELLBOX#*:}\" - $(_) $(PWD)/startup.script - $(EPICS) -