Skip to content

Commit

Permalink
handle cxi and make sure we dont touch monreq processes
Browse files Browse the repository at this point in the history
  • Loading branch information
vespos committed Dec 11, 2024
1 parent 539bdf8 commit 4eaaf9d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/startami2
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ restart_all(){
# Restart all the AMI2-related proc-servers
echo "Restarting all AMI2 processes"
for i in "${!AMI2_PROC[@]}"; do
if [[ ${AMI2_PROC[i]} =~ "monreqsrv" ]]; then
continue # skip monreq processes that might have ami2 in their name
fi
echo "${AMI2_PROC[i]}"
echo "${AMI2_HOST[i]}"
echo "${AMI2_STATUS[i]}"
Expand All @@ -50,8 +53,10 @@ restart_all(){
stop_all(){
# Stops all the AMI2-related proc-servers
echo "Stopping all AMI2 processes"
for i in "${!AMI2_PROC[@]}"
do
for i in "${!AMI2_PROC[@]}"; do
if [[ ${AMI2_PROC[i]} =~ "monreqsrv" ]]; then
continue # skip monreq processes that might have ami2 in their name
fi
echo "${AMI2_PROC[i]}"
echo "${AMI2_HOST[i]}"
echo "${AMI2_STATUS[i]}"
Expand Down Expand Up @@ -84,10 +89,14 @@ else
fi

PROCMGR="/cds/group/pcds/dist/pds/$HUTCH/current/tools/procmgr/procmgr"
CNF="/reg/g/pcds/dist/pds/$HUTCH/scripts/$HUTCH.cnf"
if [[ $HUTCH == "cxi" ]]; then
CNF="/reg/g/pcds/dist/pds/$HUTCH/scripts/cxi_0.cnf" # special CXI case...
else
CNF="/reg/g/pcds/dist/pds/$HUTCH/scripts/$HUTCH.cnf"
fi
STATUS_FILE="/tmp/ami2_procmgr_status_$USER"

$PROCMGR status /cds/group/pcds/dist/pds/"$HUTCH"/scripts/"$HUTCH".cnf > "$STATUS_FILE"
$PROCMGR status "$CNF" > "$STATUS_FILE"

AMI2_MGR_HOST=$(grep ami2_manager "$STATUS_FILE" | awk '{print $1}')
# shellcheck disable=SC2207
Expand Down

0 comments on commit 4eaaf9d

Please sign in to comment.