Skip to content

Commit

Permalink
fix: Set shutdown_on_stop value in config file. (#164)
Browse files Browse the repository at this point in the history
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 <maauth@amazon.com>
  • Loading branch information
matta-aws authored Feb 21, 2024
1 parent 50178ed commit 858f621
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/deadline_worker_agent/installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 858f621

Please sign in to comment.