lxc-instance.conf revision dc0682900a79cfb47fd9a416902129bfa68fdcbf
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberdescription "lxc instance"
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberauthor "Christian Kampka <chris@emerge-life.de>"
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberstop on stopping lxc
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber# wait for 120 seconds for container to shutdown before killing it
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberkill timeout 120
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber# send SIGPWR to container to trigger a shutdown (see lxc-shutdown(1))
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberkill signal SIGPWR
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberinstance $NAME
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberusage "NAME=name of LXC instance"
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberpre-start script
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber lxc-wait -s RUNNING -n $NAME -t 0 && { stop; exit 0; } || true
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberend script
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberscript
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graber exec lxc-start -n $NAME
dc0682900a79cfb47fd9a416902129bfa68fdcbfStéphane Graberend script