mirror of
https://github.com/phusion/baseimage-docker.git
synced 2026-03-26 04:18:46 +00:00
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)
|
## 0.9.19 (not yet released)
|
||||||
|
|
||||||
* Upgraded to Ubuntu 16.04. Thanks to Pierre Jacomet for submitting this patch.
|
* 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)
|
## 0.9.18 (release date: 2015-12-08)
|
||||||
|
|
||||||
|
|||||||
@@ -244,8 +244,9 @@ def wait_for_runit_or_interrupt(pid):
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
return (False, None)
|
return (False, None)
|
||||||
|
|
||||||
def shutdown_runit_services():
|
def shutdown_runit_services(quiet = False):
|
||||||
debug("Begin shutting down runit services...")
|
if not quiet:
|
||||||
|
debug("Begin shutting down runit services...")
|
||||||
os.system("/usr/bin/sv down /etc/service/*")
|
os.system("/usr/bin/sv down /etc/service/*")
|
||||||
|
|
||||||
def wait_for_runit_services():
|
def wait_for_runit_services():
|
||||||
@@ -255,6 +256,12 @@ def wait_for_runit_services():
|
|||||||
done = os.system("/usr/bin/sv status /etc/service/* | grep -q '^run:'") != 0
|
done = os.system("/usr/bin/sv status /etc/service/* | grep -q '^run:'") != 0
|
||||||
if not done:
|
if not done:
|
||||||
time.sleep(0.1)
|
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():
|
def install_insecure_key():
|
||||||
info("Installing insecure SSH key for user root")
|
info("Installing insecure SSH key for user root")
|
||||||
|
|||||||
Reference in New Issue
Block a user