Skip to content

Commit

Permalink
enos: support ancient systemd in vault_upgrade (#27960)
Browse files Browse the repository at this point in the history
Amazon Linux 2 uses an ancient version of Systemd/systemctl so instead
of using -P when determining the unit file we use the less convenient
-p.

Signed-off-by: Ryan Cragun <[email protected]>
  • Loading branch information
ryancragun authored Aug 2, 2024
1 parent 720e942 commit e246b26
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ fi

# Get the unit file for the vault.service that is running. If it's not in /etc/systemd then it
# should be a package provided unit file so we don't need to delete anything.
if ! unit_path=$(systemctl show -P FragmentPath vault 2>&1); then
#
# Note that we use -p instead of -P so that we support ancient amzn2 systemctl.
if ! unit_path=$(systemctl show -p FragmentPath vault | cut -d = -f2 2>&1); then
echo "Skipped removing unit file because and existing path could not be found: $unit_path"
exit 0
fi
Expand Down

0 comments on commit e246b26

Please sign in to comment.