prometheanfire    14/03/16 19:27:14

  Modified:             glance.initd
  Log:
  fixes for bug 504266 (and fixed the creation of /var/run/glance on install
  
  (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 
0x2471eb3e40ac5ac3)

Revision  Changes    Path
1.5                  app-admin/glance/files/glance.initd

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/glance/files/glance.initd?rev=1.5&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/glance/files/glance.initd?rev=1.5&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/glance/files/glance.initd?r1=1.4&r2=1.5

Index: glance.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-admin/glance/files/glance.initd,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- glance.initd        19 Dec 2013 05:20:42 -0000      1.4
+++ glance.initd        16 Mar 2014 19:27:14 -0000      1.5
@@ -1,74 +1,22 @@
 #!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 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.4 
2013/12/19 05:20:42 prometheanfire Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/glance/files/glance.initd,v 1.5 
2014/03/16 19:27:14 prometheanfire Exp $
 
-depend() {
-    need net
-}
+description="Starts ${SVCNAME}  service for OpenStack"
 
-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 [ ${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
-}
+command=/usr/bin/${SVCNAME}
+command_background=yes
+pidfile=/var/run/glance/${SVCNAME}.pid
+required_files=/etc/glance/${SVCNAME}.conf
 
+start_stop_daemon_args="--quiet --user ${GLANCE_USER:-glance}"
 
-start() {
-    checkconfig || return $?
-    . /etc/conf.d/$BASENAME
-    
-    ebegin "Starting ${SVCNAME}"
-    if [ ! -d ${PID_PATH} ]; then
-        mkdir ${PID_PATH}
-    fi
-    
-    if [ ${SVCNAME} == 'glance' ]; then
-        for service in ${SERVICES[*]}; do
-            start-stop-daemon --start --quiet --background --make-pidfile 
--pidfile "${PID_PATH}/glance-${service}.pid" --user glance:glance --exec 
/usr/bin/glance-${service} -- --config-file /etc/glance/glance-${service}.conf
-        done
-    else
-        start-stop-daemon --start --quiet --background --make-pidfile 
--pidfile "${PID_PATH}/${SVCNAME}.pid" --user glance:glance --exec 
/usr/bin/glance-${SERVERNAME} -- --config-file 
/etc/glance/glance-${SERVERNAME}.conf
-    fi
-    eend $? "Failed to start ${SVCNAME}"
+depend() {
+       need net
 }
 
-stop() {
-    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-${service} -- 
--config-file /etc/glance/glance-${service}.conf
-        done
-    else
-        start-stop-daemon --stop --quiet --pidfile 
"${PID_PATH}/${SVCNAME}.pid" --exec /usr/bin/glance-control -- ${SERVERNAME} -- 
--config-file /etc/glance/glance-${SERVERNAME}.conf
-    fi
-    eend $? "Failed to stop ${SVCNAME}"
+start_pre() {
+       checkpath --dir --owner ${GLANCE_USER:-glance}:${GLANCE_GROUP:-glance} 
--mode 0664 ${GLANCE_RUN:-/var/run/glance}
 }
 
-#restart() {
-#
-#}
\ No newline at end of file




Reply via email to