forked from Docker/baseimage-docker
During shutdown, repeatedly tell Runit to shutdown services
Works around a potential race condition in Runit itself. Closes GH-315. Thanks to Chris Kite for submitting this patch.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
## 0.9.19 (not yet released)
|
||||
|
||||
* Upgraded to Ubuntu 16.04. Thanks to Pierre Jacomet for submitting this patch.
|
||||
* During shutdown, repeatedly tell Runit to shutdown services in order to workaround a potential race condition in Runit itself. Closes GH-315. Thanks to Chris Kite for submitting this patch.
|
||||
|
||||
|
||||
## 0.9.18 (release date: 2015-12-08)
|
||||
|
||||
|
||||
@@ -244,7 +244,8 @@ def wait_for_runit_or_interrupt(pid):
|
||||
except KeyboardInterrupt:
|
||||
return (False, None)
|
||||
|
||||
def shutdown_runit_services():
|
||||
def shutdown_runit_services(quiet = False):
|
||||
if not quiet:
|
||||
debug("Begin shutting down runit services...")
|
||||
os.system("/usr/bin/sv down /etc/service/*")
|
||||
|
||||
@@ -255,6 +256,12 @@ def wait_for_runit_services():
|
||||
done = os.system("/usr/bin/sv status /etc/service/* | grep -q '^run:'") != 0
|
||||
if not done:
|
||||
time.sleep(0.1)
|
||||
# According to https://github.com/phusion/baseimage-docker/issues/315
|
||||
# there is a bug or race condition in Runit, causing it
|
||||
# not to shutdown services that are already being started.
|
||||
# So during shutdown we repeatedly instruct Runit to shutdown
|
||||
# services.
|
||||
shutdown_runit_services(true)
|
||||
|
||||
def install_insecure_key():
|
||||
info("Installing insecure SSH key for user root")
|
||||
|
||||
Reference in New Issue
Block a user