Merge "avoid multi chef client run starts" into dev/experimental
This commit is contained in:
commit
fc34b4e9ce
@ -24,10 +24,19 @@
|
||||
cat << EOF > /etc/chef/chef_client_run.sh
|
||||
#!/bin/bash
|
||||
touch /tmp/chef.log
|
||||
PIDFILE=/tmp/chef_client_run.pid
|
||||
if [ -f \\$PIDFILE ]; then
|
||||
pid=\\$(cat \\$PIDFILE)
|
||||
if [ -f /proc/\\$pid/exe ]; then
|
||||
echo "there are chef_client_run.sh running with pid \\$pid" &>> /tmp/chef.log
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo \\$$ > \\$PIDFILE
|
||||
while true; do
|
||||
echo "run chef-client on \`date\`" &>> /tmp/chef.log
|
||||
clients=\\$(pgrep chef-client)
|
||||
if [ "\\$?" == "0" ]; then
|
||||
if [[ "\\$?" == "0" ]]; then
|
||||
echo "there are chef-clients '\\$clients' running" &>> /tmp/chef.log
|
||||
break
|
||||
else
|
||||
|
@ -1,9 +1,9 @@
|
||||
#if $str($getVar('anamon_enabled','')) == "1"
|
||||
#if $getVar("compass_server", "") != ""
|
||||
#if $getVar("compass_server", "") != ""
|
||||
wget -O /tmp/anamon "http://$compass_server:$http_port/cobbler/aux/anamon"
|
||||
python /tmp/anamon --name "$name" --server "$compass_server" --port "$http_port"
|
||||
#else
|
||||
#else
|
||||
wget -O /tmp/anamon "http://$server:$http_port/cobbler/aux/anamon"
|
||||
python /tmp/anamon --name "$name" --server "$_server" --port "$http_port"
|
||||
#end if
|
||||
python /tmp/anamon --name "$name" --server "$server" --port "$http_port"
|
||||
#end if
|
||||
#end if
|
||||
|
@ -23,10 +23,19 @@
|
||||
cat << EOF > /etc/chef/chef_client_run.sh
|
||||
#!/bin/bash
|
||||
touch /tmp/chef.log
|
||||
PIDFILE=/tmp/chef_client_run.pid
|
||||
if [ -f \\$PIDFILE ]; then
|
||||
pid=\\$(cat \\$PIDFILE)
|
||||
if [ -f /proc/\\$pid/exe ]; then
|
||||
echo "there are chef_client_run.sh running with pid \\$pid" &>> /tmp/chef.log
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo \\$$ > \\$PIDFILE
|
||||
while true; do
|
||||
echo "run chef-client on \`date\`" &>> /tmp/chef.log
|
||||
clients=\\$(pgrep chef-client)
|
||||
if [ "\\$?" == "0" ]; then
|
||||
if [[ "\\$?" == "0" ]]; then
|
||||
echo "there are chef-clients '\\$clients' running" &>> /tmp/chef.log
|
||||
break
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user