mirror_lxc/config/init/upstart/lxc-instance.conf
Stéphane Graber dc0682900a init: Add upstart jobs and some more changes (v3)
This adds the 3 upstart jobs that we've had in Ubuntu for a while:
 - lxc.conf: Main upstart job, triggers lxc-net.conf based on config
 - lxc-instance.conf: Triggered by lxc.conf for each auto-started container
 - lxc-net.conf: Triggered by lxc.conf, sets up lxcbr0, NAT, mangling, ...

In addition, there are two extra config files in /etc/default:
 - lxc: Allows setting some values like http proxying, disabling autostart, ...
 - lxc-net: Network configuration for the lxcbr0 bridge

This change also disables the sysv script for all distros but Oracle as
the current script won't work on either Ubuntu nor Debian and I suspect
quite a few more distros, so it's not nearly as distro-agnostic as we
thought.

For Debian, only install the upstart jobs and systemd unit.
For Ubuntu, only install the upstart jobs.

This change also moves all the init related stuff to config/init/

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-16 17:18:38 -05:00

23 lines
462 B
Plaintext

description "lxc instance"
author "Christian Kampka <chris@emerge-life.de>"
stop on stopping lxc
# wait for 120 seconds for container to shutdown before killing it
kill timeout 120
# send SIGPWR to container to trigger a shutdown (see lxc-shutdown(1))
kill signal SIGPWR
instance $NAME
usage "NAME=name of LXC instance"
pre-start script
lxc-wait -s RUNNING -n $NAME -t 0 && { stop; exit 0; } || true
end script
script
exec lxc-start -n $NAME
end script