Home > OS >  Shell was blocked in the implementation process, the process is pending
Shell was blocked in the implementation process, the process is pending

Time:09-29

Question phenomenon:
At the time of executing scripts, will be the emergence of probabilistic script execution to half card
the condition of the Lord


The check process, found that this command sleep



Under the great god told what reason,

A shell script logic:
 
#!/bin/bash
The set -x
The namespace=onap
Recovery_tmp=/opt/matrix/app/data/recovery_tmp

# replace the file
ReplaceFile () {
J=0
Cassandra_pod=` kubectl get the pods - n ${namespace} | grep dev - SDC - cs | grep -v SDC - cs - c | awk -f ' '{print $1}' `
For I in ${cassandra_pod}; Do
Kubectl exec ${I} - n ${namespace} - rm - rf/var/lib/sdc_cs/
Dlog "-- -- -- -- -- -- -- -- -- -- -- -- the rm ${I} - rf/var/lib/sdc_cs/end -- -- -- -- -- -- -- -- -- -- -- -- --"
Sleep 3
Kubectl cp ${recovery_tmp}/sdc_cs/Cassandra - ${j}/commitlog ${namespace}/${I} :/var/lib/Cassandra & gt;/dev/null
Kubectl cp ${recovery_tmp}/sdc_cs Cassandra - ${j} ${namespace}/data/${I} :/var/lib/Cassandra & gt;/dev/null
Kubectl cp ${recovery_tmp}/sdc_cs/Cassandra - ${j}/saved_caches/${namespace}/${I} :/var/lib/Cassandra & gt;/dev/null
If [0] "${?}" - can be; Then
Dlog "[ERROR] [${I}] Cassandra replace failed."
The info 1 "${I} [] Cassandra replace"
The exit - 1;
The else
Dlog "[INFO] [${I}] Cassandra replace finished."
Fi
Let j +=1
The done
Return 0
}

ReplaceFile

  • Related