Skip to content

Commit

Permalink
Merge pull request #747 from JiaoDean/master
Browse files Browse the repository at this point in the history
retry systemctl start csiplugin-connector.service
  • Loading branch information
fredkan authored Mar 21, 2023
2 parents c27e0a9 + ddff030 commit a4c3737
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
21 changes: 18 additions & 3 deletions build/lib/amd64-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,27 @@ if [ "$run_oss" = "true" ] || [ "$run_disk" = "true" ]; then
if [ "$updateConnectorService" = "true" ]; then
echo "Install csiplugin connector service...."
cp /csi/csiplugin-connector.service $systemdDir/csiplugin-connector.service
${HOST_CMD} systemctl daemon-reload
echo "Starting systemctl daemon-reload."
until ${HOST_CMD} systemctl daemon-reload
do
echo "Starting retry again systemctl daemon-reload."
sleep 2
done
fi

rm -rf /var/log/alicloud/connector.pid
${HOST_CMD} systemctl enable csiplugin-connector.service
${HOST_CMD} systemctl restart csiplugin-connector.service
echo "Starting systemctl enable csiplugin-connector.service."
until ${HOST_CMD} systemctl enable csiplugin-connector.service
do
echo "Starting retry again systemctl enable csiplugin-connector.service."
sleep 2
done
echo "Starting systemctl restart csiplugin-connector.service."
until ${HOST_CMD} systemctl restart csiplugin-connector.service
do
echo "Starting retry again systemctl restart csiplugin-connector.service."
sleep 2
done
fi

## CPFS-NAS plugin setup
Expand Down
23 changes: 20 additions & 3 deletions build/lib/arm64-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ mkdir -p /host/etc/kubernetes/volumes/disk/uuid
ossfsVer="1.80.6.ack.1"
armfsVer="1.80.6"

HOST_CMD="/nsenter --mount=/proc/1/ns/mnt"

## check which plugin is running
for item in $@;
do
Expand Down Expand Up @@ -135,12 +137,27 @@ if [ "$run_disk" = "true" ] || [ "$run_oss" = "true" ]; then
if [ "$updateConnectorService" = "true" ]; then
echo "Install csiplugin connector service...."
cp /csi/csiplugin-connector.service $systemdDir/csiplugin-connector.service
/nsenter --mount=/proc/1/ns/mnt systemctl daemon-reload
echo "Starting systemctl daemon-reload."
until ${HOST_CMD} systemctl daemon-reload
do
echo "Starting retry again systemctl daemon-reload."
sleep 2
done
fi

rm -rf /var/log/alicloud/connector.pid
/nsenter --mount=/proc/1/ns/mnt systemctl enable csiplugin-connector.service
/nsenter --mount=/proc/1/ns/mnt systemctl restart csiplugin-connector.service
echo "Starting systemctl enable csiplugin-connector.service."
until ${HOST_CMD} systemctl enable csiplugin-connector.service
do
echo "Starting retry again systemctl enable csiplugin-connector.service."
sleep 2
done
echo "Starting systemctl restart csiplugin-connector.service."
until ${HOST_CMD} systemctl restart csiplugin-connector.service
do
echo "Starting retry again systemctl restart csiplugin-connector.service."
sleep 2
done

fi

Expand Down

0 comments on commit a4c3737

Please sign in to comment.