use dns, iocinfo, caputLog, epics7

This commit is contained in:
2019-08-08 17:17:21 +02:00
parent 14bef77b9a
commit 9ff0b4bd67
8 changed files with 121 additions and 73 deletions

View File

@@ -9,7 +9,7 @@
EPICS_MODULES = "/ioc/modules"
# find a better way later to know current require version
REQUIRE_VERSION="2.5.2"
REQUIRE_VERSION="2.9.2"
#set EPICS_HOST_ARCH according to vxWorks version and cpu type
VX6=(*runtimeVersion>>24)&255-'5'
@@ -27,8 +27,8 @@ STRINGBUFFER=malloc(256)
sprintf STRINGBUFFER, "%s (startup.script aborted) > ", IOC
shellPromptSet STRINGBUFFER
# time server
putenv "EPICS_TS_NTP_INET=129.129.190.1"
# Set DNS if necessary
resolvInit "129.129.190.11","psi.ch"
# do the NFS mounts and other network dependend stuff
< ../../startup/network
@@ -42,11 +42,10 @@ putenv STRINGBUFFER
sprintf STRINGBUFFER, "EPICS_HOST_ARCH=%s", EPICS_HOST_ARCH
putenv STRINGBUFFER
# setup logging to gfa-syslog
putenv "EPICS_IOC_LOG_INET=gfa-syslog"
putenv "EPICS_IOC_LOG_PORT=1514"
# create some path variables
BASEBIN=malloc(80)
sprintf BASEBIN, "/epics/base-%s/bin/%s", EPICS+1, EPICS_HOST_ARCH
HOME=malloc(80)
sprintf HOME, "/ioc/%s", IOC
sprintf STRINGBUFFER, "HOME=%s", HOME
@@ -78,19 +77,35 @@ sprintf TEMPLATES, ".:%s/iocBoot/templates", INSTBASE
# at the moment snp24 does not work with this
memAddToPool (sysMemTop(),sysPhysMemTop()-sysMemTop())
EXTENDED_MEMORY=0
#EXTENDED_MEMORY=sysPhysMemTop()-sysMemTop()
# load EPICS system core (different names for 3.13 and 3.14)
sprintf STRINGBUFFER, "%s/iocCore%s", LIB, strncmp(EPICS,"R3.13.",6) ? "Library.munch" : ""
# Setup Time
# 2019:
putenv "EPICS_TIMEZONE=MET::-60:033102:102703"
putenv "EPICS_TS_MIN_WEST=-60"
putenv "EPICS_TS_NTP_INET=129.129.190.1"
putenv "EPICS_TS_FORCE_NTPTIME=YES"
# Need to branch a few times on EPICS base release
R3_13=strncmp(EPICS,"R3.13.",6)==0
R3_14=strncmp(EPICS,"R3.14.",6)==0
# Load EPICS system core (different names for different EPICS versions)
# Unfortunately we have no 'if' and line length is quite limited
# 3.13: load "iocCore"
# 3.14: load "iocCoreLibrary.munch"
# 3.15+: load "softIoc.munch" (could do this from 3.14.12 on)
sprintf STRINGBUFFER, "%s/%s",BASEBIN,R3_13?"iocCore":R3_14?"iocCoreLibrary.munch":"softIoc.munch"
printf "loading %s\n",STRINGBUFFER
ld 0, 0, STRINGBUFFER
# TIMEZONE must be set after loading iocCoreLibrary.munch and before iocInit
# 2017:
putenv "TIMEZONE=MET::-60:032602:102903"
putenv "EPICS_TS_MIN_WEST=-60"
# EPICS 3.13 needs this to not use synchronized timestamps
sprintf STRINGBUFFER,strncmp(EPICS,"R3.13.",6) ? ";" : "TSconfigure(0,10,10,18323,18322,250,1)"
execute STRINGBUFFER
# Start Logging
putenv "EPICS_IOC_LOG_INET=gfa-syslog"
putenv "EPICS_IOC_LOG_PORT=1514"
iocLogInit
errlogPrintf "Starting EPICS %s\n", EPICS
# Allow backward compatible non-monotonic breaktables for EPICS > 3.14.8
dbBptNotMonotonic=1
# try for user-defined menus scan and convert
dbLoadDatabase "dbd/scan.dbd"
@@ -98,6 +113,12 @@ dbLoadDatabase "dbd/convert.dbd"
dbLoadDatabase "dbd/slsConvert.dbd"
taskDelay sysClkRateGet()
sprintf STRINGBUFFER,R3_13||R3_14?";":"dbLoadDatabase \"/epics/base-%s/dbd/softIoc.dbd\"",EPICS+1
execute STRINGBUFFER
sprintf STRINGBUFFER,R3_13||R3_14?";":"softIoc_registerRecordDeviceDriver pdbbase"
execute STRINGBUFFER
# load "require"
sprintf STRINGBUFFER, "require_VERSION=%s", getenv("require_VERSION") ? getenv("require_VERSION") : REQUIRE_VERSION
putenv STRINGBUFFER
@@ -107,16 +128,29 @@ sprintf STRINGBUFFER, "%s/lib/%s/requireLib.munch", getenv("require_DIR"), EPICS
ld 0, 0, STRINGBUFFER
#load standard drivers (allow user to specify version in environment variable)
require "base", getenv("base_VERSION")
require "base", getenv("base_VERSION") ? getenv("base_VERSION") : "ifexists"
registerModule "require", getenv("require_VERSION"), getenv("require_DIR")
sprintf STRINGBUFFER,strncmp(EPICS,"R3.13.",6) ? "require_registerRecordDeviceDriver pdbbase" : ";"
sprintf STRINGBUFFER,R3_13?";":"require_registerRecordDeviceDriver pdbbase"
execute STRINGBUFFER
require "utilities", getenv("utilities_VERSION")
require "misc", getenv("misc_VERSION")
require "seq", getenv("seq_VERSION") ? getenv("seq_VERSION") : "ifexists"
# caPutLog
#epicsEnvSet "EPICS_CA_PUT_LOG_ADDR", "gfa-syslog:1515 sf-logstash.psi.ch:1515"
epicsEnvSet "EPICS_CA_PUT_LOG_PREFIX", IOC
require "caPutLog", getenv("caPutLog_VERSION")?getenv("caPutLog_VERSION"):"ifexists"
# IOC monitoring
require "iocmon", getenv("iocmon_VERSION")
require R3_13||R3_14?"iocmon":"iocStats", getenv(R3_13||R3_14?"iocmon_VERSION":"iocStats_VERSION")
# Battery monitoring
require "M48T37", "ifexists"
# Database Upload
require "iocinfo", getenv("iocinfo_VERSION")
# Sequencer for backward compatibility with missing dependencies
require "seq", R3_13||R3_14?"2.0":"none"
# run EPICS only on 1st network port
putenv "EPICS_CA_AUTO_ADDR_LIST=NO"
@@ -125,7 +159,8 @@ putenv bootInfo("EPICS_CAS_INTF_ADDR_LIST=%e")
putenv "EPICS_CAS_AUTO_BEACON_ADDR_LIST=NO"
putenv bootInfo("EPICS_CAS_BEACON_ADDR_LIST=%B")
# insert boot infos into database
bootNotify INSTBASE, "sls/bin/iocBootNotify.sh"
# EPICS 3.13 needs this to not use synchronized timestamps
sprintf STRINGBUFFER,R3_13?"TSconfigure(0,10,10,18323,18322,250,1)":";"
execute STRINGBUFFER
# end of startup.script_common