. The standard startup is done entirely with 3 soft links. The commands to set up vioc-b34-bd32 would be: > cd $IOC > mkdir vioc-b34-bd32 > cd vioc-b34-bd32 > ln -s ../skel/startup_ioc.cmd startup.cmd > ln -s ../All/screenrc screenrc > ln -s ../../iocTop/MyTest/Development iocSpecificRelease If the directory name where the app-specific st.cmd is located is the same as the name of this direcotry, and its name is st.cmd, nothing more is required in this directory and you can skip the rest of this question. These defaults may be overridden in a custom startup.cmd. Rather than creading the soft link, make a copy ("cp ../skel/startup_ioc.cmd startup.cmd") and at the top define environment variables $EPICS_IOC_APP or $ST_CMD. That is, the default values that startup.cmd passes to All/common/linuxRT_st.cmd are EPICS_IOC_APP is iocSpecificRelease/iocBoot/$VIOC, and ST_CMD is "st.cmd", but you can define them to be something else like epicsEnvSet("EPICS_IOC_APP", "iocSpecificRelease/iocBoot/li20/vioc-b34-bd32") epicsEnvSet("ST_CMD", "st.dev.cmd") Note that because startup_ioc.cmd is a generic script, there is no "!#" at the top, so it is not executable. It is intended to be used by the linuxRT_startup_ioc.sh (script that linuxRT_cpu_load_iocs.sh calls for each IOC at boot) or linuxRT_startupConsole.sh scripts, which determine the executable. It may also be run directly as an argument to the executable on the command line, e.g. "./iocSpecificRelease/bin/linuxRT-x86/MyTest startup.cmd". You may also create more customized scripts. For example the 'startupConsole-bd32.cmd' lets you start your EPICS ioc as a foreground process in your host. This lets you observe the ioc startup process to catch errors and interact with the ioc shell via iocConsole. Generally linuxRT_startupConsole.sh would be used instead, as it does the same basic thing. This is useful during development for debugging. Once the ioc has been tested fully, you can automatically start and run the process in background.
Under linuxRT, your EPICS ioc must run as a real-time process. It must lock the kernel in memory.
The following command in your 'startupConsole-bd32.cmd' does that: ulimit -l unlimited
The following line is also needed to run the ioc with real-time priorities:
ulimit -r unlimited
Finally, you will be running your ioc as a specific user called as 'laci' who has permissions to run this ioc: Setup the permissions for this user 'laci':
umask 002
Now you are ready to start your IOC and have it run as a foreground process.
Create a directory called as 'vioc-b34-bd32' for your ioc as below: mkdir $IOC/vioc-b34-bd32 cd $IOC/ioc-b34-bd32 ln -s ../vioc-b34-bd32
cd $IOC/ioc-b34-bd32/vioc-b34-bd32 Set up a soft link to the 'bin' directory of your IOC app that you created in step (6). This is where your executable is:
ln -s /afs/slac/g/lcls/epics/R3-14-12-4_1-0/iocTop/MyTest/Development/bin/linuxRT-x86 bin Create an ASCII text file called 'screenrc' with the following lines in it: deflog on logtstamp on defscrollback 10000 'screenrc' is passed as an argument to the 'screen' process and allows us to customize a few parameters such as number of lines stored in history buffer that we can scroll back for viewing. In the same directory $IOC/ioc-b34-my01/vioc-b34-my01, add a startup script 'startup.cmd' for vioc-b34-my01:
It setups some shell environment variables used by all iocs, and starts the st.cmd file in your ioc boot directory.
The EPICS environment variables that are set in this script can be used by your application's st.cmd script. The default st.cmd script generated by the module icdTemplates, expects the following environment values to be defined somewhere. iocStartup.cmd may be a good place to define it: epicsEnvSet("IOC_NAME","VIOC:B34:BD32") epicsEnvSet("IOC_APP","/afs/slac/g/lcls/epics/R3-14-12-4_1-0/iocTop/MyTest/Development") epicsEnvSet("IOC_BOOT","${IOC_APP}/iocBoot/vioc-b34-bd32") epicsEnvSet("IOC_COMMON","/afs/slac/g/lcls/epics/iocCommon") epicsEnvSet("SYS_FACILITY","SYS0") In addition to setting these environment variables, this script also executes some scripts common to all EPICS IOCs, such as below: ${IOC_COMMON}/All/Dev/linuxRT_pre_st.cmd
${IOC_COMMON}/All/Dev/linuxRT_post_st.cmd The IOC application startup occurs between the pre and post scirpts: cd ${IOC_BOOT} < st.cmd |