|
33 | 33 | $HOST_CMD rm -f /etc/packages-microsoft-prod.deb
|
34 | 34 | fi
|
35 | 35 |
|
36 |
| -if [ ! -f "/host/usr/bin/blobfuse-proxy" ];then |
| 36 | +updateBlobfuseProxy="true" |
| 37 | +if [ -f "/host/usr/bin/blobfuse-proxy" ];then |
| 38 | + old=$(sha256sum /host/usr/bin/blobfuse-proxy | awk '{print $1}') |
| 39 | + new=$(sha256sum /blobfuse-proxy/blobfuse-proxy | awk '{print $1}') |
| 40 | + if [ "$old" = "$new" ];then |
| 41 | + updateBlobfuseProxy="false" |
| 42 | + echo "no need to update blobfuse-proxy" |
| 43 | + fi |
| 44 | +fi |
| 45 | + |
| 46 | +if [ "$updateBlobfuseProxy" = "true" ];then |
37 | 47 | echo "copy blobfuse-proxy...."
|
| 48 | + rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock |
38 | 49 | cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy
|
39 | 50 | chmod 755 /host/usr/bin/blobfuse-proxy
|
40 | 51 | fi
|
41 | 52 |
|
42 |
| -if [ ! -f "/host/usr/lib/systemd/system/blobfuse-proxy.service" ];then |
| 53 | +updateService="true" |
| 54 | +if [ -f "/host/usr/lib/systemd/system/blobfuse-proxy.service" ];then |
| 55 | + old=$(sha256sum /host/usr/lib/systemd/system/blobfuse-proxy.service | awk '{print $1}') |
| 56 | + new=$(sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk '{print $1}') |
| 57 | + if [ "$old" = "$new" ];then |
| 58 | + updateService="false" |
| 59 | + echo "no need to update blobfuse-proxy.service" |
| 60 | + fi |
| 61 | +fi |
| 62 | + |
| 63 | +if [ "$updateService" = "true" ];then |
43 | 64 | echo "copy blobfuse-proxy.service...."
|
44 | 65 | mkdir -p /host/usr/lib/systemd/system
|
45 | 66 | cp /blobfuse-proxy/blobfuse-proxy.service /host/usr/lib/systemd/system/blobfuse-proxy.service
|
46 | 67 | fi
|
47 | 68 |
|
48 |
| -if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ] |
49 |
| -then |
50 |
| - $HOST_CMD systemctl daemon-reload |
51 |
| - $HOST_CMD systemctl enable blobfuse-proxy.service |
52 |
| - # According to the issue https://github.com/kubernetes-sigs/blob-csi-driver/issues/693, |
53 |
| - # do NOT RESTART blobfuse-proxy, just start it at first time. |
54 |
| - $HOST_CMD systemctl start blobfuse-proxy.service |
| 69 | +if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then |
| 70 | + if [ "$updateBlobfuseProxy" = "true" ] || [ "$updateService" = "true" ];then |
| 71 | + echo "start blobfuse-proxy...." |
| 72 | + $HOST_CMD systemctl daemon-reload |
| 73 | + $HOST_CMD systemctl enable blobfuse-proxy.service |
| 74 | + $HOST_CMD systemctl restart blobfuse-proxy.service |
| 75 | + fi |
55 | 76 | fi
|
56 | 77 |
|
57 | 78 | if [ "${SET_MAX_OPEN_FILE_NUM}" = "true" ]
|
|
0 commit comments