summaryrefslogtreecommitdiff
path: root/omnibus/package-scripts/chef-fips/preinst
diff options
context:
space:
mode:
Diffstat (limited to 'omnibus/package-scripts/chef-fips/preinst')
-rwxr-xr-xomnibus/package-scripts/chef-fips/preinst9
1 files changed, 7 insertions, 2 deletions
diff --git a/omnibus/package-scripts/chef-fips/preinst b/omnibus/package-scripts/chef-fips/preinst
index 834c29544b..0baebe07f4 100755
--- a/omnibus/package-scripts/chef-fips/preinst
+++ b/omnibus/package-scripts/chef-fips/preinst
@@ -7,6 +7,11 @@
# this programming language. do not touch.
# - if you are under 40, get peer review from your elders.
-INSTALLER_DIR=/opt/chef-fips
+INSTALLER_DIR=/opt/chef
echo "removing $INSTALLER_DIR..."
-rm -rf $INSTALLER_DIR
+
+# we have to move the dir before trying to wipe it and then ignore errors since
+# files may still be in use.
+tmp_dir="/opt/.chef.$$"
+mv $INSTALLER_DIR $tmp_dir
+rm -rf $tmp_dir || true