-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iocutca, service: use a single afc-ioc service.
This means we need to use decode-reg in run.sh to know what type of board is being used, in order to launch the appropriate st.cmd file.
- Loading branch information
Showing
9 changed files
with
73 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
export SLOT=$1 | ||
|
||
CRATE=$(./getCrate.sh) | ||
VSLOT=$(./getSlot.sh $SLOT) | ||
|
||
cmd= | ||
case "$(decode-reg build_info -q --slot ${SLOT})" in | ||
afc-tim-receive*) | ||
CRATE=${CRATE#0} | ||
|
||
. ./tim-slot-mapping | ||
val_name=CRATE_${CRATE}_TIM_RX_${VSLOT}_PV_AREA_PREFIX | ||
eval "export AREA_PREFIX=\$${val_name}" | ||
val_name=CRATE_${CRATE}_TIM_RX_${VSLOT}_PV_DEVICE_PREFIX | ||
eval "export DEVICE_PREFIX=\$${val_name}" | ||
|
||
case $(hostname) in | ||
ia-*) ;; | ||
*) export EPICS_CA_ADDR_LIST=10.0.38.59:60000 | ||
esac | ||
|
||
cmd=TIM | ||
;; | ||
afcv4_fofb_ctrl*) | ||
. ./fofb-slot-mapping | ||
val_name=CRATE_${CRATE}_FOFB_${VSLOT}_PV_AREA_PREFIX | ||
eval "export AREA_PREFIX=\$${val_name}" | ||
val_name=CRATE_${CRATE}_FOFB_${VSLOT}_PV_DEVICE_PREFIX | ||
eval "export DEVICE_PREFIX=\$${val_name}" | ||
export RTM_PREFIX=SI-${CRATE} | ||
|
||
cmd=FOFB | ||
;; | ||
esac | ||
|
||
if [ -n "$cmd" ]; then | ||
exec procServ -f -n afc-ioc-${SLOT} -L- -i ^C^D -P $(expr 1700 + ${SLOT%-*}) ./st${cmd}.cmd | ||
fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SUBSYSTEM=="pci", ATTR{vendor}=="0x10ee", ATTR{subsystem_device}=="0x0007", RUN+="/usr/bin/setpci -s %k COMMAND=0x2", RUN+="/bin/sh -c 'chmod 666 /sys/bus/pci/devices/%k/resource*'", RUN+="/opt/erics/service/erics-start.sh %k" | ||
SUBSYSTEM=="pci", ATTR{vendor}=="0x10ee", ATTR{subsystem_device}=="0x0007", RUN+="/usr/bin/setpci -s %k COMMAND=0x2", RUN+="/bin/sh -c 'chmod 666 /sys/bus/pci/devices/%k/resource*'", RUN+="/opt/afc-epics-ioc/service/ioc-start.sh %k" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=AFC EPICS IOC %i | ||
|
||
[Service] | ||
User=iocs | ||
Group=iocs | ||
|
||
MemoryAccounting=yes | ||
|
||
WorkingDirectory=/opt/afc-epics-ioc/iocBoot/iocutca | ||
ExecStart=/opt/afc-epics-ioc/iocBoot/iocutca/run.sh %i |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
DEV=$1 | ||
|
||
devslot= | ||
for slot in /sys/bus/pci/slots/* ; do | ||
ADDR=$(cat ${slot}/address) | ||
if [ "${ADDR}.0" = "${DEV}" ]; then | ||
devslot=$(basename ${slot}) | ||
break | ||
fi | ||
done | ||
|
||
case "$(decode-reg build_info -q --slot ${devslot})" in | ||
afc-tim-receive*|afcv4_fofb_ctrl*) | ||
systemctl restart afc-ioc@${devslot}.service | ||
;; | ||
esac |