]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix container creation from ansible lxc_containers module 588/head
authorAlex Punco <punco@selectel.ru>
Sun, 12 Jul 2015 12:52:57 +0000 (15:52 +0300)
committerAlex Punco <punco@selectel.ru>
Mon, 13 Jul 2015 14:42:45 +0000 (17:42 +0300)
Signed-off-by: Alex Punco <punco@selectel.ru>
config/init/common/lxc-containers.in

index 73ccdbac3bbdba721c51328a31a27ce27e998687..ebce36e3e125da48961427517c71d44498984e4c 100644 (file)
@@ -78,13 +78,13 @@ case "$1" in
         if [ -n "$BOOTGROUPS" ]; then
             BOOTGROUPS="-g $BOOTGROUPS"
         fi
-
+        touch "$lockdir"/lxc
         # Start containers
         wait_for_bridge
 
         # Start autoboot containers first then the NULL group "onboot,".
         "$bindir"/lxc-autostart $OPTIONS $BOOTGROUPS
-        touch "$lockdir"/lxc
+        rm -f "$lockdir"/lxc
     ;;
 
     stop)
@@ -96,7 +96,6 @@ case "$1" in
         # delaying the system shutdown / reboot as much as we can since it's not
         # parallelized...  Even 5 second timout may be too long.
         "$bindir"/lxc-autostart $STOPOPTS $SHUTDOWNDELAY
-        rm -f "$lockdir"/lxc
     ;;
 
     restart|reload|force-reload)