diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-12-13 13:30:14 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-12-13 13:30:14 -0800 |
commit | 190e39fcb17240b8ac07d7c5784d77417137e206 (patch) | |
tree | 3d86b89f9485f2ad3ae84e3c2fa28c049fcdc016 /omnibus | |
parent | 87e0d8ae8babd9c38b5b3c440cb774fd3b558e38 (diff) | |
download | chef-190e39fcb17240b8ac07d7c5784d77417137e206.tar.gz |
fix EBUSY errors in preinst script
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'omnibus')
-rwxr-xr-x | omnibus/package-scripts/angrychef/preinst | 9 | ||||
-rwxr-xr-x | omnibus/package-scripts/chef-fips/preinst | 9 | ||||
-rwxr-xr-x | omnibus/package-scripts/chef/preinst | 7 |
3 files changed, 20 insertions, 5 deletions
diff --git a/omnibus/package-scripts/angrychef/preinst b/omnibus/package-scripts/angrychef/preinst index b3038a10c6..0baebe07f4 100755 --- a/omnibus/package-scripts/angrychef/preinst +++ b/omnibus/package-scripts/angrychef/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/angrychef +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 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 diff --git a/omnibus/package-scripts/chef/preinst b/omnibus/package-scripts/chef/preinst index 1880275e99..0baebe07f4 100755 --- a/omnibus/package-scripts/chef/preinst +++ b/omnibus/package-scripts/chef/preinst @@ -9,4 +9,9 @@ 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 |