Avoid race condition with 1 second sleep.
Upstart will return from 'start xxx' immediately upon forking. We still need to run start-stop-daemon, change users, exec again, and then run the python code to get to listen() before the service is actually ready. This all should take < 1s, but the sleep is just a stopgap until we have a better way to track "is the service ready" in upstart. Fixes bug #1179766 Change-Id: I3842e572c940e833cb3036b67df0ee71fe5bb129
This commit is contained in:
parent
49d54f5545
commit
567e8a0599
|
@ -20,6 +20,9 @@ end script
|
|||
respawn
|
||||
|
||||
exec start-stop-daemon --start -c $user --exec /opt/stack/venvs/$user/bin/$cmd -- $args
|
||||
|
||||
# Help avoid race with daemon listening. http://pad.lv/1179766
|
||||
post-start exec sleep 1
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue