mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CLOUDSTACK-2639: Add flag for booting complete
Don't execute any command before VR complete booting up process.
This commit is contained in:
parent
780b45e245
commit
07715b91af
@ -33,6 +33,9 @@ PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
|
||||
# Fix haproxy directory issue
|
||||
mkdir -p /var/lib/haproxy
|
||||
|
||||
# Clear boot up flag, it would be created by rc.local after boot up done
|
||||
rm /var/cache/cloud/boot_up_done
|
||||
|
||||
[ -x /sbin/ifup ] || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
@ -13,3 +13,6 @@ do
|
||||
logger -t cloud "Stopping $svc"
|
||||
service $svc stop
|
||||
done
|
||||
|
||||
date > /var/cache/cloud/boot_up_done
|
||||
logger -t cloud "Boot up process done"
|
||||
|
||||
@ -16,5 +16,31 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# As the last command send to router before any rules operation, wait until boot up done
|
||||
|
||||
__TIMEOUT=60
|
||||
__FLAGFILE=/var/cache/cloud/boot_up_done
|
||||
done=0
|
||||
for i in `seq 1 $(($__TIMEOUT * 10))`
|
||||
do
|
||||
if [ -e $__FLAGFILE ]
|
||||
then
|
||||
done=1
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
if [ $((i % 10)) -eq 0 ]
|
||||
then
|
||||
logger -t cloud "Waiting for VM boot up done for one second"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z $done ]
|
||||
then
|
||||
# declare we failed booting process
|
||||
echo "Waited 60 seconds but boot up haven't been completed"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo -n `cat /etc/cloudstack-release`'&'
|
||||
cat /var/cache/cloud/cloud-scripts-signature
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user