Skip to content

Commit

Permalink
Enhance manual machine cleanup script
Browse files Browse the repository at this point in the history
The updated script ensures that the systemd service files for juju are
always deleted. Additionally, the script also detects and cleans up the
juju-db snap if installed (2.8+).
  • Loading branch information
achilleasa committed May 22, 2020
1 parent d84e4ec commit 113be28
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cloudconfig/userdatacfg_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ for path_to_unit in $(ls /etc/systemd/system/juju*); do
systemctl stop "$unit"
systemctl disable "$unit"
systemctl daemon-reload
rm -f "$path_to_unit"
done
echo "removing /var/lib/juju/db/*"
Expand All @@ -86,6 +87,12 @@ rm -rf /var/lib/juju/raft/*
echo "removing /var/run/juju/*"
rm -rf /var/run/juju/*
has_juju_db_snap=$(snap info juju-db | grep installed)
if [ ! -z "$has_juju_db_snap" ]; then
echo "removing juju-db snap and any persisted database data"
snap remove --purge juju-db
fi
`
)

Expand Down

0 comments on commit 113be28

Please sign in to comment.