Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 'virtual' 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-my01bd32' for your 'virtual' ioc process under the following directory:

$IOC/ioc-b34-my01bd32
 
cd $IOC/ioc-b34-my01bd32/vioc-b34-my01bd32
 
Set up a soft link to the 'bin' directory of your IOC app that you created in step (6):

ln -s /afs/slac/g/lcls/epics/R3-14-12-3_1-0/iocTop/MyAppTest/Development/bin/linuxRT-x86 bin

In the same directory $IOC/ioc-b34-my01/vioc-b34-my01, add a startup script 'iocStartup.cmd' for vioc-b34-my01:

This script is very similar to the Soft IOC startup scripts that we are familiar with.
It setups some env variables used by all iocs, then changes to the ioc boot directory and starts the st.cmd file.

12. How do I start my ioc and monitor it?

Example, from any lcls-dev host ssh to your ioc as 'laci':

ssh laci@ioc-b34-bd32

$ cd /afs/slac/g/lcls/epics/iocCommon/ioc-b34-bd32

Ensure that 'startupConsole-laci-rt.cmd' is in your current directory.

Start the virtual ioc as a foreground process:

./startupConsole-laci-rt.cmd

13. How do I start my ioc automatically every time my server boots up?

You can start your ioc as a background process that will start up everytime your Linux server reboots, as follows:

In $IOC/ioc-b34-bd32, you can add another script 'startup-laci-rt.cmd' that lets you start your EPICS-based 'virtual' ioc as a background process in your host.

Invoke this script from  $IOC/ioc-b34-bd32/startup.cmd directly after the kernel modules are loaded, as below:

.

/afs/slac/g/lcls/epics/iocCommon/eioc-li28-mg01/kernel-modules.cmd

su laci -c /usr/local/lcls/epics/iocCommon/eioc-li28-mg01/startup-laci-rt.cmd

The above line starts another shell so that the user called "laci" can start the IOC Process as opposed to the "root" account

Remember, the kernel modules can only be loaded onto the kernel with "root" permissions but iocs can be run by users.

'startup-laci-rt.cmd' executes the EPICS-based IOC startup script and detaches it using the linux screen program

It contains the following lines which are similar to what we have in startupConsole-laci-rt.cmd:

# Lock Kernel in memory
ulimit -l unlimited
# Run with real-time priorities
ulimit -r unlimited

# Set umask for the laci user
umask 002

# EPICS IOC Application Real-time Process

cd $IOC/ioc-b34-bd32/vioc-b34-bd32

 screen -h 8192 -dm -S vioc-b34-b32 `pwd` $APP/Test/Development/bin/linuxRT-x86/MyTest iocStartup.cmd

The above line will automatically start your ioc and have it running in the background, every time your server reboots

14. Which script calls what and what parameters are passed from one to another?

Here's a flowchart that shows which script calls what and Which script calls what an what parameters are passed from one to another?Here's a flowchart that shows which script calls what an some of the important parameters that can be passed from one to another:

...