File: oci-agent-daemon

package info (click to toggle)
openstack-cluster-installer 43.0.22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,544 kB
  • sloc: php: 19,169; sh: 18,137; ruby: 75; makefile: 31; xml: 8
file content (18 lines) | stat: -rwxr-xr-x 653 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

set -e

# Start once immediately
/usr/bin/openstack-cluster-installer-agent >>/var/log/openstack-cluster-installer-agent.log 2>&1 || true

# Contact PXE server once, anytime, during this interval
INTERVAL=30
while [ 1 ] ; do
	# To avoid flooding the PXE server, the agents don't connect all
	# at the same time, but once during an interval of 30 seconds.
	DELAY=$((  $(dd if=/dev/urandom bs=512 count=1 2>&1 | cksum | cut -d' ' -f1) % ${INTERVAL} ))
	END_COMMAND=$(( ${INTERVAL} - ${DELAY} ))
	sleep ${DELAY}
	/usr/bin/openstack-cluster-installer-agent >>/var/log/openstack-cluster-installer-agent.log 2>&1 || true
	sleep ${END_COMMAND}
done