[boot-script] add hack to be sure no salt-call is running.

This is an ugly workaround. But until something better is found, this is necessary to make sure the program runs at boot in automatic mode

(closes #149110)

authorPaul Tonelli <paul.tonelli@logilab.fr>
changeset506d0fb93a6b
branchdefault
phasepublic
hiddenno
parent revision#785b21aef8c9 [build]correct build for jpg file
child revision#5a6f7425f820 [doc] add warning that user should not call variation sls file
files modified by this revision
others/rc.local
# HG changeset patch
# User Paul Tonelli <paul.tonelli@logilab.fr>
# Date 1385470731 -3600
# Tue Nov 26 13:58:51 2013 +0100
# Node ID 506d0fb93a6bacbb971f93679bfa801af6fb29b0
# Parent 785b21aef8c9d19d4c5706d22cb6012b751b5931
[boot-script] add hack to be sure no salt-call is running.

This is an ugly workaround. But until something better is found, this is necessary to make sure the program runs at boot in automatic mode

(closes #149110)

diff --git a/others/rc.local b/others/rc.local
@@ -16,13 +16,23 @@
1  /usr/bin/env python /etc/salt/srv/others/ec2_ami_parser.py
2 
3  ## get updated code if necessary 
4  for i in `seq 3`
5  do
6 +    while [ `pgrep -c salt-call` -ne 0 ]
7 +    do
8 +        sleep 1
9 +    done
10 +    ## wait until salt-call is not running any longer
11      salt-call --no-color state.highstate | tee -a /var/log/ami-creator.log > /dev/console 2>&1
12  done
13 
14 +while [ `pgrep -c salt-call` -ne 0 ]
15 +do
16 +    sleep 1
17 +done
18 +## wait until salt-call is not running any longer
19  ## download, untar, resize and mount
20  ## update modify image depending on variation.sls file
21  salt-call --no-color state.sls ami_creator | tee -a /var/log/ami-creator.log > /dev/console 2>&1
22  ## umount, resize and upload if possible
23