Skip to content

Commit

Permalink
service: start RFFE IOC for BPMs.
Browse files Browse the repository at this point in the history
Whenever a BPM board is detected, both the AFC and RFFE IOCs should be
started automatically. Since RFFEs are connected to a single BPM, it is
necessary to start up two RFFE IOCs for each BPM board. In order to
track these services, their virtual slot is used. Physical slot 12 is an
exceptional case as it's always only connected to one BPM, so we don't
run the RFFE IOC for virtual slot 24.

So the script doesn't require the RFFE IOC being installed on the
system, making it optional to successfully start up its services.
  • Loading branch information
henriquesimoes authored and ericonr committed Sep 20, 2024
1 parent 7266ca4 commit 963bff2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions service/ioc-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,25 @@ for slot in /sys/bus/pci/slots/* ; do
fi
done

start_afc_ioc=false

case "$(decode-reg build_info -q --slot ${devslot})" in
afc-tim-receive*|afcv4_fofb_ctrl*|pbpm-gw*|bpm-gw*)
systemctl restart afc-ioc@${devslot}.service
afc-tim-receive*|afcv4_fofb_ctrl*|pbpm-gw*)
start_afc_ioc=true
;;
bpm-gw*)
start_afc_ioc=true

VSLOT1=$(/opt/afc-epics-ioc/iocBoot/iocutca/getSlot.sh $devslot)
VSLOT2=$(( VSLOT1 + 1 ))

services="rffe-ioc@${VSLOT1}.service"
[ "$VSLOT2" -lt 24 ] && services="$services rffe-ioc@${VSLOT2}.service"

systemctl start $services || true
;;
esac

if $start_afc_ioc; then
systemctl restart afc-ioc@${devslot}.service
fi

0 comments on commit 963bff2

Please sign in to comment.