Epics@GSI Webhome

HOWTO: setup HADES IOC to start at reboot

Objective

“When switching on or in case of a hardware reset of the system the IOC is running on, the IOC should be (re)started automatically at reboot.”

Project data

The whole project cvs branch can be found here:
  • CVSROOT: :ext:[<valid user>@]lxi001.gsi.de:/misc/hadesprojects/daq/cvsroot
  • module: EPICS/startupProcedures

Basics and Commons

  • The mechanisms used are based on shell scripts (not bash, but rather dash since its the the least common denominator) on the systems
  • They run on linux systems
    softIOC and special IOCs x86-based
    hadcon and TRB axis cris architecture
  • They do also all rely on procServ, a Process Server with Telnet Console and Log Access

Common Shell scripts

At least softIOC and hadcon use the same set of basic scripts, which might be called differently but should always be available.
  • The procServ calling script startBackgroundEpicsIoc.sh
    ... (Click to expand) Click to expand
  • and its helper script exitIfHelpers.sh used by the other scripts
    ... (Click to expand) Click to expand

-- PeterZumbruch - 24 Feb 2010

softIOC

At lxg0434 (GSI network) and hadesdaq02 (HADES network)

  • cron and
  • procServ, a Process Server with Telnet Console and Log Access

are used to start as user scs the IOCs

Status

On both systems similar script files in the directory ~scs/procServ are called by cron at reboot

machine script crontab -e / crontab -l comments
hadesdaq02 ioc-cave.sh @reboot cd ~scs/procServ/ && ./ioc-cave.sh requires settings for shared libraries
lxg0434 ioc-hv.sh @reboot cd ~scs/procServ/ && ./ioc-hv.sh requires settings for shared libraries
needs to be started at lxg0434 since
since log files are on /scratch.local/ due to size
template ioc-template.sh @reboot cd ~scs/procServ/ && ./ioc-template.sh template for further commands

Scripts

... (Click to expand) Click to expand
... (Click to expand) Click to expand
... (Click to expand) Click to expand

-- PeterZumbruch - 03 Mar 2010

Install

... (Click to expand) Click to expand

Thanks to Sergey Yurevich for the great support.
-- PeterZumbruch - 05 Mar 2010

special IOCs and EPICS client and servers

channel Archiver

channel Server

Gateway

-- PeterZumbruch - 05 Mar 2010

hadcon

The hadcon boards executes at startup/reboot the content of the /home/hadaq/etc/rc script file.
Since procServ, a Process Server with Telnet Console and Log Access , has also been compiled to run on the ETRAX CRIS architecture - see also this little HowTo - we use procServ also here.

  • The rc script resides on the mounted file system from lxhadesdaq and shows up on the local mount point /home/hadaq/etc/rc
    • while it can originally be found on /var/diskless/etrax of lxhadesdaq,
      the place to edit and change as user hadaq.
      • while this is not fully true, since you are advised to develop the code somewhere else, and copy the results to /var/diskless/etrax since this is not in the backup :-/

Mechanism

Based on this startup script all further mechanism for an automatic (re)start have been adopted:

Basic concept

  • One single <EPICS IOC (re)start script> is called/sourced from rc
    • small code within general rc script
  • Depending on the hostname the <EPICS IOC (re)start script> calls <EPICS IOC start Background script> which calls the corresponding EPICS IOC executable with its additional varying <Startup cmd Script> by using the functionalities of procServ
    • Besides its default values the <EPICS IOC (re)start script> should be called using a lookup table text file
      • the text file may be also created by calls to a database, but not during runtime
      • e.g. IocListFile.txt
        ... (Click to expand) Click to expand
    • <EPICS IOC (re)start script> analyzes the lookup table or input options and selects depending on hostname
    • <EPICS IOC start Background script> calls procServ with the embedding of the EPICS IOC

Prerequisites

  • correct system time
    • contained in rc
  • correct MAC address (?)
    • used to have switch script for etrax04x, contained in rc,
    • what about others etrax1xx ?
  • hostname available via command hostname
    • o.k.
  • export HOSTNAME=$(hostname)
    • o.k.
  • procServ installed
    • where
      • /home/hadaq/procServ
      • copy of /home/hadaq/EPICS/startupProcedures/procServ
    • what additions to LD_LIBRARY_PATH are needed
      • /home/hadaq/EPICS/startupProcedures/procServ/lib
  • list of hadcons: <EPICS-IOCS>.txt
    • maybe created via a database (also as first column of the lookup file)
    • but static from the point of view of the hadcons at startup, i.e. at startup no database access

Modifications

  • Created directory /home/hadaq/EPICS/startupProcedures
  • Changed rc script to just hold callers to scripts in /home/hadaq/EPICS/startupProcedures
    ... (Click to expand) Click to expand
  • Created in /home/hadaq/EPICS/startupProcedures script resetMACs.sh calling callee resetMAC.sh
    ... (Click to expand) Click to expand
  • Modified/Extended in /home/hadaq/EPICS/startupProcedures the procServ calling script startBackgroundEpicsIoc.sh
    ... (Click to expand) Click to expand
  • Created in /home/hadaq/EPICS/startupProcedures script startEpicsIoc.sh calling callee startBackgroundEpicsIoc.sh
    ... (Click to expand) Click to expand
  • Created in /home/hadaq/EPICS/startupProcedures helper script exitIfHelpers.sh used by the other scripts
    ... (Click to expand) Click to expand
  • Created in /home/hadaq/EPICS/startupProcedures lookup table file IocListFile.txt
    ... (Click to expand) Click to expand
  • Again changed rc script in /home/hadaq/etc to call the specific iocListFile
    ... (Click to expand) Click to expand
  • Created tar file: EPICS_startupProcedures_hadcon.tar.bz2 of all necessary startup directory structure and files in /home/hadaq/EPICS

-- PeterZumbruch - 11 Feb 2010

Install / Add / New

Change / TODO

  • Adopt / Combine startBackgroundEpicsIOC.sh and ioc-template.sh

TRB


-- PeterZumbruch - 05 Mar 2010
I Attachment Action Size Date Who Comment
EPICS_startupProcedures_hadcon.tar.bz2bz2 EPICS_startupProcedures_hadcon.tar.bz2 manage 2 MB 2010-02-11 - 17:56 PeterZumbruch Tar file: EPICS_startupProcedures_hadcon.tar.bz2
startupProcedures_softIOC.tar.gzgz startupProcedures_softIOC.tar.gz manage 6 K 2010-03-03 - 14:10 PeterZumbruch Tar file: EPICS_startupProcedures_softIOC.tar.gz
Topic revision: r20 - 2010-03-05, PeterZumbruch - This page was cached on 2024-12-19 - 20:01.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)