From 858f621e4939b0b5bc32262bc90cc4fa80dd148e Mon Sep 17 00:00:00 2001 From: matta-aws <68977061+matta-aws@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:43:45 -0800 Subject: [PATCH] fix: Set shutdown_on_stop value in config file. (#164) Problem: Running the installer does not set the shutdown_on_stop value in the config file. Solution: It now sets it to "true" or "false" based on --allow_shutdown flag. Signed-off-by: Matt Authement --- src/deadline_worker_agent/installer/install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/deadline_worker_agent/installer/install.sh b/src/deadline_worker_agent/installer/install.sh index a382b92b..17b3fb34 100755 --- a/src/deadline_worker_agent/installer/install.sh +++ b/src/deadline_worker_agent/installer/install.sh @@ -364,11 +364,19 @@ chown -R "root:${wa_user}" /etc/amazon/deadline chmod 640 /etc/amazon/deadline/worker.toml echo "Done provisioning configuration directory" +if [[ "${allow_shutdown}" == "yes" ]]; then + shutdown_on_stop="true" +else + shutdown_on_stop="false" +fi + echo "Configuring farm and fleet" +echo "Configuring shutdown on stop" sed -E \ --in-place=.bak \ -e "s,^# farm_id\s*=\s*\"REPLACE-WTIH-WORKER-FARM-ID\"$,farm_id = \"${farm_id}\",g" \ -e "s,^# fleet_id\s*=\s*\"REPLACE-WITH-WORKER-FLEET-ID\"$,fleet_id = \"${fleet_id}\",g" \ + -e "s,^[#]*\s*shutdown_on_stop\s*=\s*\w+$,shutdown_on_stop = ${shutdown_on_stop},g" \ /etc/amazon/deadline/worker.toml echo "Done configuring farm and fleet"