Skip to content

Commit 30dafe1

Browse files
committed
fix: force copy blobfuse2 binary to avoid Text file busy error (#1425)
* fix: force copy blobfuse2 binary to avoid Text file busy error * fix * fix
1 parent 8fe2206 commit 30dafe1

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

pkg/blobfuse-proxy/install-proxy-rhcos.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@
1717
set -xe
1818

1919
# in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2
20+
updateBlobfuse2="true"
2021
if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ]
2122
then
23+
if [ -f "/host/usr/local/bin/blobfuse2" ];then
24+
old=$(sha256sum /host/usr/local/bin/blobfuse2 | awk '{print $1}')
25+
new=$(sha256sum /usr/bin/blobfuse2 | awk '{print $1}')
26+
if [ "$old" = "$new" ];then
27+
updateBlobfuse2="false"
28+
echo "no need to update blobfuse2 since no change"
29+
fi
30+
fi
31+
else
32+
echo "no need to install blobfuse2"
33+
updateBlobfuse2="false"
34+
fi
35+
if [ "$updateBlobfuse2" = "true" ];then
2236
echo "copy blobfuse2...."
23-
cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2
37+
cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 --force
38+
chmod 755 /host/usr/local/bin/blobfuse2
2439
fi
2540

2641
# install blobfuse-proxy
@@ -35,9 +50,8 @@ if [ -f "/host/usr/local/bin/blobfuse-proxy" ];then
3550
fi
3651
if [ "$updateBlobfuseProxy" = "true" ];then
3752
echo "copy blobfuse-proxy...."
38-
rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock
39-
rm -rf /host/usr/local/bin/blobfuse-proxy
40-
cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy
53+
rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock
54+
cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force
4155
chmod 755 /host/usr/local/bin/blobfuse-proxy
4256
fi
4357

pkg/blobfuse-proxy/install-proxy.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ if [ -f "/host/usr/bin/blobfuse-proxy" ];then
8989
fi
9090
if [ "$updateBlobfuseProxy" = "true" ];then
9191
echo "copy blobfuse-proxy...."
92-
rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock
93-
rm -rf /host/usr/bin/blobfuse-proxy
94-
cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy
92+
rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock
93+
cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy --force
9594
chmod 755 /host/usr/bin/blobfuse-proxy
9695
fi
9796

0 commit comments

Comments
 (0)