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.en...@oracle.com>
---
 templates/lxc-oracle.in |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in
index ba62f8f..9a875af 100644
--- a/templates/lxc-oracle.in
+++ b/templates/lxc-oracle.in
@@ -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
 }
 
-- 
1.7.1



------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to