[openstack-glance/el6] openstack-glance-db-setup: fix startup issue with log files

Pádraig Brady pbrady at fedoraproject.org
Tue Apr 10 13:15:51 UTC 2012


commit 80a0bbfa3f61ad1fdbaf9738ba3babf6e9c581e7
Author: Pádraig Brady <P at draigBrady.com>
Date:   Tue Apr 10 12:51:55 2012 +0100

    openstack-glance-db-setup: fix startup issue with log files
    
    Ensure logs files are not created as root
    from the db sync commands of the db setup script

 openstack-glance-db-setup |   10 ++++------
 openstack-glance.spec     |    5 ++++-
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/openstack-glance-db-setup b/openstack-glance-db-setup
index e1f0eb9..95a2a83 100755
--- a/openstack-glance-db-setup
+++ b/openstack-glance-db-setup
@@ -247,12 +247,10 @@ fi
 # Ask openstack-$APP to sync the db.
 
 echo "Asking openstack-$APP to sync the database."
-if [ "${APP}" = "nova" ]; then
-	nova-manage db sync
-else
-	# glance and keystone
-	$APP-manage db_sync
-fi
+[ "${APP}" = "nova" ] && db_sync='db sync' || db_sync='db_sync'
+# Run as $APP user so any newly created (log) files have correct ownership
+runuser -s /bin/sh $APP -c "$APP-manage $db_sync"
+
 
 # Do a final sanity check on the database.
 
diff --git a/openstack-glance.spec b/openstack-glance.spec
index a35a7f9..65efeb5 100644
--- a/openstack-glance.spec
+++ b/openstack-glance.spec
@@ -1,6 +1,6 @@
 Name:             openstack-glance
 Version:          2012.1
-Release:          1%{?dist}
+Release:          2%{?dist}
 Summary:          OpenStack Image Service
 
 Group:            Applications/System
@@ -221,6 +221,9 @@ fi
 %doc doc/build/html
 
 %changelog
+* Tue Apr 10 2012 Pádraig Brady <P at draigBrady.com> - 2012.1-2
+- Fix startup failure due to a file ownership issue (#811130)
+
 * Mon Apr  9 2012 Pádraig Brady <P at draigBrady.com> - 2012.1-1
 - Update to Essex final
 


More information about the scm-commits mailing list