diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-09-28 21:47:46 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-09-28 21:47:46 +0000 |
commit | ddde6fb70249e4c9cadcf8e684b9b9623e331f40 (patch) | |
tree | aad3fd16a994f9d66ef4f4af192e5ceb6dcdb294 /app-emulation | |
parent | Version bump, the bmc-watchdog patch is properly upstreamed. (diff) | |
download | gentoo-2-ddde6fb70249e4c9cadcf8e684b9b9623e331f40.tar.gz gentoo-2-ddde6fb70249e4c9cadcf8e684b9b9623e331f40.tar.bz2 gentoo-2-ddde6fb70249e4c9cadcf8e684b9b9623e331f40.zip |
Fix init script to find the correct PID for the container's init and use a 30-seconds timeout to see if it has stopped correctly. Thanks to Stef Simoens for both (bug #384265).
(Portage version: 2.2.0_alpha59/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation')
-rw-r--r-- | app-emulation/lxc/ChangeLog | 10 | ||||
-rw-r--r-- | app-emulation/lxc/files/lxc.initd | 14 | ||||
-rw-r--r-- | app-emulation/lxc/lxc-0.7.5-r2.ebuild (renamed from app-emulation/lxc/lxc-0.7.5-r1.ebuild) | 2 |
3 files changed, 19 insertions, 7 deletions
diff --git a/app-emulation/lxc/ChangeLog b/app-emulation/lxc/ChangeLog index d1add772c90b..992a2ecc8361 100644 --- a/app-emulation/lxc/ChangeLog +++ b/app-emulation/lxc/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-emulation/lxc # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.27 2011/09/14 19:39:40 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.28 2011/09/28 21:47:46 flameeyes Exp $ + +*lxc-0.7.5-r2 (28 Sep 2011) + + 28 Sep 2011; Diego E. Pettenò <flameeyes@gentoo.org> -lxc-0.7.5-r1.ebuild, + +lxc-0.7.5-r2.ebuild, files/lxc.initd: + Fix init script to find the correct PID for the container's init and use a + 30-seconds timeout to see if it has stopped correctly. Thanks to Stef Simoens + for both (bug #384265). *lxc-0.7.5-r1 (14 Sep 2011) diff --git a/app-emulation/lxc/files/lxc.initd b/app-emulation/lxc/files/lxc.initd index 6266193031e6..7275826025a1 100644 --- a/app-emulation/lxc/files/lxc.initd +++ b/app-emulation/lxc/files/lxc.initd @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd,v 1.7 2011/09/14 19:39:40 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd,v 1.8 2011/09/28 21:47:46 flameeyes Exp $ CONTAINER=${SVCNAME#*.} @@ -111,15 +111,19 @@ stop() { return 0 fi - init_pid=$(head -n1 ${cgroupmount}/${CONTAINER}/tasks) + init_pid=$(lxc-info -n ${CONTAINER} --pid | cut -d: -f 2) ebegin "Shutting down system in ${CONTAINER}" kill -INT ${init_pid} eend $? - sleep 15 - - missingprocs=$(pgrep -P ${init_pid}) + TIMEOUT=${TIMEOUT:-30} + i=0 + while [ -n "${missingprocs}" -a $i -lt ${TIMEOUT} ]; do + sleep 1 + missingprocs=$(pgrep -P ${init_pid}) + i=$(expr $i + 1) + done if [ -n "${missingprocs}" ]; then ewarn "Something failed to properly shut down in ${CONTAINER}" diff --git a/app-emulation/lxc/lxc-0.7.5-r1.ebuild b/app-emulation/lxc/lxc-0.7.5-r2.ebuild index 8b729caa0fce..991e418a521f 100644 --- a/app-emulation/lxc/lxc-0.7.5-r1.ebuild +++ b/app-emulation/lxc/lxc-0.7.5-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/lxc-0.7.5-r1.ebuild,v 1.1 2011/09/14 19:39:40 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/lxc-0.7.5-r2.ebuild,v 1.1 2011/09/28 21:47:46 flameeyes Exp $ EAPI="4" |