[lxc-devel] [PATCH] plamo: Improve template for lxc-stop

Stéphane Graber stgraber at ubuntu.com
Wed Dec 25 16:06:29 UTC 2013


On Wed, Dec 25, 2013 at 01:45:24PM +0900, KATOH Yasufumi wrote:
> patch /etc/inittab in plamo container to shutdown when it receives SIGPWR.
> (By default, plamo shutdowns to single user mode after 5minutes)
> 
> Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  templates/lxc-plamo.in | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/templates/lxc-plamo.in b/templates/lxc-plamo.in
> index b133da3..485f363 100644
> --- a/templates/lxc-plamo.in
> +++ b/templates/lxc-plamo.in
> @@ -178,6 +178,12 @@ configure_plamo() {
>  	EOF
>    # /etc/inittab
>    cat <<- "EOF" | patch $rootfs/etc/inittab
> +	32,33c32,33
> +	< # What to do when power fails (shutdown to single user).
> +	< pf::powerfail:/sbin/shutdown -f +5 "THE POWER IS FAILING"
> +	---
> +	> # What to do when power fails (shutdown).
> +	> pf::powerfail:/sbin/shutdown -h +0 "THE POWER IS FAILING"
>  	47a48
>  	> 1:1235:respawn:/sbin/agetty 38400 console
>  	52,53d52
> -- 
> 1.8.4.4
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20131225/65da2aae/attachment.pgp>


More information about the lxc-devel mailing list