]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Always rebuild rpm database
authorDwight Engen <dwight.engen@oracle.com>
Mon, 15 Oct 2012 13:42:10 +0000 (09:42 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 12 Nov 2012 18:18:32 +0000 (13:18 -0500)
Always rebuild the rpm database with the guest's rpm so there are no
db version mismatches when you boot the guest and run rpm or yum.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
templates/lxc-oracle.in

index 05fac59a81e17f534f35a2db28a10f4566041f14..566815112ba0aa50c8737f4a510434fa796217ef 100644 (file)
@@ -412,9 +412,13 @@ container_rootfs_create()
                $db_dump_cmd $db |$db_load_cmd $db.new
                mv $db.new $db
            done
-           chroot $container_rootfs rpm --rebuilddb
        fi
 
+       # the host rpm may not be the same as the guest, rebuild the db with
+       # the guest rpm version
+       echo "Rebuilding rpm database"
+       rm -f $container_rootfs/var/lib/rpm/__db*
+       chroot $container_rootfs rpm --rebuilddb >/dev/null 2>&1
     ) 200>/var/lock/subsys/lxc-oracle-$name
 }