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
Created attachment 362854 [details] glance-2013.2.ebuild Added glance user creation. Fix glance directories permission
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 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 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() {
merged changes, thanks (except for the slot we aren't doing that).