Package: lxc
Version: 0.7.2-1
Severity: normal
Currently, LXC init script is able to start the configured set of
containers (which is very convenient) but to stop them it uses lxc-stop
which merely kills the set of processes belonging to a container.
When a container has its own rootfs with a system created using
debootstrap or similar means, it is expected that the "stop" action
should be similar to "start", that is, something like `shutdown -h +0`
or `telinit 0` should be executed inside such containers, and then
they should be waited upon to terminate.
As I understand, the following sequence should work:
for cont in $CONTAINERS; do
lxc-attach -n "$cont" 'shutdown -h +0' \
&& lxc-wait -n "$cont" -s STOPPED \
&& lxc-stop -n "$cont"
done
The actual code can become more involved as ideally the init script should
wait for some "grace period" for the containers to shut down
and then use lxc-stop on the remaining containers forcibly.
I assume the implementation details are open for discussion.
Also, since containers are not required to virtualise a whole OS
on its own rootfs and may be used to host just one process or a bunch
of processes, there should be a way to mark container explicitly
as requiring a graceful shutdown.
Another possibility would be to specify a command to issue inside
a container to shut it down; an empty command (the default) could
signalize no graceful shutdown is required. This method would put more
burden on the administrator but is more flexible.
In any case, implementing this functionality depends on making
lxc-attach working, and I filed bug #595920 for this reason.
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages lxc depends on:
ii libc6 2.11.2-2 Embedded GNU C Library: Shared lib
ii libcap2 1:2.19-3 support for getting/setting POSIX.
Versions of packages lxc recommends:
ii libcap2-bin 1:2.19-3 basic utility programs for using c
lxc suggests no packages.
-- Configuration Files:
/etc/default/lxc changed:
RUN=yes
CONF_DIR=/etc/lxc
CONTAINERS="bender"
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]