SLAC CD Software Engineering Group

LCLS Electron-Photon Gateways



SLAC Detailed
SLAC Computing
Software Home
Software Detailed



The Electron-Photon Gateways provide support for EPICS data transfer between Electron beam (Ebeam) and Photon controls.


There are two gateways on our site: gwEbeamRequest for requesting Photon PVs by Ebeam CA clients, gwEbeamServe for serving Ebeam PVs to Photon CA clients; each Ebeam gateway is coupled with its Photon gateway partner which Amedeo in Photon group is responsible for. For instance, gwEbeamRequest is coupled with Photon Gateway Serve, and gwEbeamServe is coupled with Photon Gateway Request.

Our two gateways are hosted on a dedicated server (lcls-daemon3) sitting on a dedicated VLAN (lclspcdsn). There is a filtering router on our side and a firewall on Photon side, both of which are managed by SCCS network team. Terri is coordinating network efforts with SCCS.


Basic Management

  • The gateway configuration is in /usr/local/lcls/tools/gateway:
    • config: contains files that define PVs allow/deny (*.dat) and access security rules (*.acf)
    • display: contains EDM and StripTool files to monitor the gateways
    • script: contains gateway startup files that define the environment and execute the gateways, st.gwEbeamServe for Electron Gateway Serve, st.gwEbeamRequest for Electron Gateway Request. It also contains a few scripts for debugging gateways, in addition to EDM display for gateway monitor.
    • More to come ...
  • Check if Photon controls is available via lclshome
    • bring up lclshome
    • select "ADS/X-RAY/Misc" and the "FEE" area.
    • More to come ...
  • To monitor the PV gateways
    • login lcls-daemon3 as laci
    • to monitor gwEbeamRequest gateway


    • to monitor gwEbeamServe gateway
    • $TOOLS/gateway/display/gwEbeamServet.bash
    • more to come ... This can go to lclshome.
  • start | stop gateways
    • ssh lcls-daemon3 as laci
    • **if restarting following a gateway problem/crash, before the start command, please do

      ps -ef | grep gateway

    and make sure the gateway of choice has been stopped by the "stop" command.  If not, may need to kill (or kill -9) to stop it before the restart.

    • to start | stop gwEbeamRequest if needed

    /etc/rc3.d/S97st.gwEbeamRequest start|stop

    • to start|stop for gwEbeamServe if needed

    /etc/rc3.d/S97st.gwEbeamServe start|stop

    • To verify if gateway process are up (there should be four, two for gwEbeamRequest, two for gwEbeamServer)

    ps -ef | grep gateway to verify

    • more to come....will add this to UWD for easy restart
  • To monitor gateway log files useful for debug
    • tail -f /u1/lcls/tools/gateway/gwEbeamRequest.log
    • tail -f /u1/lcls/tools/gateway/gwEbeamServe.log
  • check caRepeater

There are two caRepeaters running on lcls-daemon3 as daemons, one for listening beacons from Photon gateway CAS part and one for listening beacons from Ebeam CAS (i.e., IOCs). The bootup script is in /etc/rc3.d/S90st.caRepeaterGW, both caRepeaters get started up at boot time before two gateway processes. They must be running, and listening to right ports. They are very robust - I have never see them crashed. Just in case ...

  • ssh lcls-daemon3 as laci
  • to see if there are running

ps -ef | grep caRepeater

  • to start | stop if needed

/etc/rc3.d/S90st.caRepeaterGW start|stop

  • more to come ... will add this to UWD for easy restart.

Expert Management and Debug


To configure gateway PV access controls to define PVs allow/deny (*.dat) and access security rules (*.acf)

  • ssh lcls-builder as softegr
  • cd $TOOLS/gateway/config
  • update gwEbeamRequest.acf, gwEbeamRequest.dat  for gwEbeamRequest
  • update gwEbeamServe.acf, gwEbeamServe.dat for gwEbeamServe
  • restart gateways to make the change effective.

Basic debug

  • check "ADS/X-RAY/Misc" and the "FEE" area in lclshome
  • check gateway monitor displays to see what is going on with our gateways
  • check logs as always.

More about debug: how can you tell if a failure is due to Ebeam gateway or Photon gateway:

  • run $TOOLS/gateway/script/testElectronGWrequest on lcls-builder from command. For example, it should return a timestamp for a photon PV, if both gateways (gwEbeamRequest and Photon Gateway Serve) work. If not,
  • run $TOOLS/gateway/display/gwEbeamRequest.bash to see if there is any problem with gwEbeamRequest. If not,
  • run $TOOLS/gateway/script/testPhotonGWserver on lcls-daemon3 as laci to see if there is any problem with Photon Gateway Serve. Basically, this test bypasses our gateway. If you don't get the time stamp from the test, then there is a problem either in Photon Gateway serve or Photon's IOCs.
  • Call Amedeo immediately if there is a problem on Photon side.
  • for system expert (e.g. KenB with root privilege) to dig more:

netstat -anp | grep caRepeater to see if there are two caRepeaters listening UDP port 5071 and 5069.

/usr/sbin/tcpdump -i eth0 host

/usr/sbin/tcpdump -i eth0 -X host or icmp

...more to come ...

Expert Management and Debug

Reference: port definition


Created by Jingchen Zhou on June 25, 2009

Modified by xxx on