Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 490838 - app-admin/glance-2013.2 should depend on >=dev-python/oslo-config-1.2.1
Summary: app-admin/glance-2013.2 should depend on >=dev-python/oslo-config-1.2.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-11-09 11:13 UTC by Davide Rebeccani
Modified: 2013-11-18 03:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
glance-2013.2.ebuild (glance-2013.2.ebuild,3.49 KB, text/plain)
2013-11-09 11:16 UTC, Davide Rebeccani
Details
New glance init.d file (glance-2.initd,2.12 KB, text/plain)
2013-11-09 11:25 UTC, Davide Rebeccani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Rebeccani 2013-11-09 11:13:59 UTC
In app-admin/glance-2013.2 build the is a dependency defined as: 
>=dev-python/oslo-config-1.2.0

With this del glance-control doesn't work. I've submitted a new dev-python/oslo-config-1.2.1 which solves the issue and modified the build to use it.

I've also added a glance user to run glance deamons

Reproducible: Always
Comment 1 Davide Rebeccani 2013-11-09 11:16:18 UTC
Created attachment 362854 [details]
glance-2013.2.ebuild

Added glance user creation.
Fix glance directories permission
Comment 2 Davide Rebeccani 2013-11-09 11:25:26 UTC
Created attachment 362856 [details]
New glance init.d file

New glance init.d file with specification of config file for each service otherwise the deamons won't start.

I've also added the --user parameter to execute glance deamons under the glance user.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-12 14:12:17 UTC
Comment on attachment 362854 [details]
glance-2013.2.ebuild

--- glance-2013.2.ebuild        2013-10-29 06:02:54.000000000 +0100
+++ -   2013-11-12 15:12:06.086405797 +0100
@@ -13,7 +13,7 @@
 SRC_URI="http://launchpad.net/${PN}/havana/${PV}/+download/${P}.tar.gz"
 LICENSE="Apache-2.0"
-SLOT="0"
+SLOT="havana"
 KEYWORDS="~amd64 ~x86"
 IUSE="mysql postgres +sqlite +swift"
 REQUIRED_USE="|| ( mysql postgres sqlite )"
@@ -44,7 +44,7 @@
                >=dev-python/kombu-2.4.8[${PYTHON_USEDEP}]
                >=dev-python/pycrypto-2.6[${PYTHON_USEDEP}]
                >=dev-python/iso8601-0.1.4[${PYTHON_USEDEP}]
-               >=dev-python/oslo-config-1.2.0[${PYTHON_USEDEP}]
+               >=dev-python/oslo-config-1.2.1[${PYTHON_USEDEP}]
                swift? (
                        >=dev-python/python-swiftclient-1.5[${PYTHON_USEDEP}]
                        <dev-python/python-swiftclient-2[${PYTHON_USEDEP}]
@@ -62,6 +62,11 @@
 PATCHES=(
 )
+pkg_setup() {
+        enewgroup glance
+        enewuser glance -1 -1 /var/lib/glance glance
+}
+
 python_install() {
        distutils-r1_python_install
        newconfd "${FILESDIR}/glance.confd" glance
@@ -73,12 +78,14 @@
        diropts -m 0750
        dodir /var/run/glance /var/log/glance /var/lib/glance/images /var/lib/glance/scrubber
-       keepdir /etc/glance
+       fowners glance:glance /var/run/glance /var/log/glance /var/lib/glance/images /var/lib/glance/scrubber
        keepdir /var/log/glance
        keepdir /var/lib/glance/images
        keepdir /var/lib/glance/scrubber
        insinto /etc/glance
+       keepdir /etc/glance
+       fowners glance:glance /etc/glance
        doins "etc/glance-api-paste.ini"
        doins "etc/glance-api.conf"
        doins "etc/glance-cache.conf"
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-12 14:13:39 UTC
Comment on attachment 362856 [details]
New glance init.d file

--- files/glance.initd  2013-09-15 16:12:48.107859139 +0200
+++ -   2013-11-12 15:12:47.662150465 +0100
@@ -1,51 +1,71 @@
 #!/sbin/runscript
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/glance/files/glance.initd,v 1.3 2013/09/12 06:27:27 prometheanfire Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/glance/files/glance-2.initd,v 1.1 2013/09/26 00:58:07 prometheanfire Exp $
 
 depend() {
-       need net
+    need net
 }
 
 BASENAME=$(echo $SVCNAME | cut -d '-' -f 1)
 SERVERNAME=$(echo $SVCNAME | cut -d '-' -f 2)
+SERVICES=( api registry scrubber )
+if [ ${SVCNAME} == 'glance' ]; then
+    SERVERNAME='all'
+fi
 
 checkconfig() {
-       if [ ! -r /etc/conf.d/$BASENAME ]; then
-               eerror "No glance conf.dfile found: /etc/conf.d/$BASENAME)"
-               return 1
-       fi
-       if [ ! -r /etc/glance/${SVCNAME}.conf ]; then
-               eerror "No ${BASENAME} config file found: /etc/glance/${SVCNAME}.conf)"
-               return 1
-       fi
-       return 0
+    if [ ! -r /etc/conf.d/$BASENAME ]; then
+        eerror "No glance conf.dfile found: /etc/conf.d/$BASENAME)"
+        return 1
+    fi
+    if [ ${SVCNAME} == 'glance' ]; then
+        for service in ${SERVICES[*]}; do
+            if [ ! -r /etc/glance/glance-${service}.conf ]; then
+                eerror "No glance-${SERVICE} config file found: /etc/glance/glance-${SERVICE}.conf)"
+                return 1
+            fi
+        done
+    elif [ ! -r /etc/glance/${SVCNAME}.conf ]; then
+        eerror "No ${BASENAME} config file found: /etc/glance/${SVCNAME}.conf)"
+        return 1
+    fi
+    return 0
 }
 
 
 start() {
-       checkconfig || return $?
-       . /etc/conf.d/$BASENAME
-
-       ebegin "Starting ${SVCNAME}"
+    checkconfig || return $?
+    . /etc/conf.d/$BASENAME
+    
+    ebegin "Starting ${SVCNAME}"
     if [ ! -d ${PID_PATH} ]; then
         mkdir ${PID_PATH}
     fi
-
-    start-stop-daemon --start --quiet --pidfile "${PID_PATH}/${SVCNAME}.pid" --exec /usr/bin/glance-control ${SERVERNAME} start 
-
-       eend $? "Failed to start ${SVCNAME}"
+    
+    start-stop-daemon --start --quiet --pidfile "${PID_PATH}/${SVCNAME}.pid" --user glance \
+                       --exec /usr/bin/glance-control ${SERVERNAME} start \
+                       /etc/glance/glance-${SERVERNAME}.conf
+    
+    eend $? "Failed to start ${SVCNAME}"
 }
 
 stop() {
-       checkconfig || return $?
-       . /etc/conf.d/$BASENAME
-
-       ebegin "Stopping ${SVCNAME}"
-
-       start-stop-daemon --stop --quiet --pidfile "${PID_PATH}/${SVCNAME}.pid" \
-                                         --exec /usr/bin/glance-control ${SERVERNAME} stop /etc/glance/glance-${SERVERNAME}.conf
-       eend $? "Failed to stop ${SVCNAME}"
+    checkconfig || return $?
+    . /etc/conf.d/$BASENAME
+    
+    ebegin "Stopping ${SVCNAME}"
+    
+    if [ ${SVCNAME} == 'glance' ]; then
+        for service in ${SERVICES[*]}; do
+            start-stop-daemon --stop --quiet --pidfile "${PID_PATH}/glance-${service}.pid" \
+                    --exec /usr/bin/glance-control ${service} stop /etc/glance/glance-${service}.conf
+        done
+    else
+        start-stop-daemon --stop --quiet --pidfile "${PID_PATH}/${SVCNAME}.pid" \
+                --exec /usr/bin/glance-control ${SERVERNAME} stop /etc/glance/glance-${SERVERNAME}.conf
+    fi
+    eend $? "Failed to stop ${SVCNAME}"
 }
 #restart() {
Comment 5 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-11-18 03:03:38 UTC
merged changes, thanks (except for the slot we aren't doing that).