[openstack-glance/el6] add upstart jobs for RHEL6

Alan Pevec apevec at fedoraproject.org
Mon Jun 25 11:05:13 UTC 2012


commit 7557528a17e79542f8d87a8facd37ce62deb9ec2
Author: Alan Pevec <apevec at redhat.com>
Date:   Mon Jun 25 12:58:12 2012 +0200

    add upstart jobs for RHEL6
    
    alternative to sysv initscript, only one can be enabled!
    Disable sysv initscripts, before using upstart jobs:
    
     service $SERVICE stop
     chkconfig $SERVICE off
    
    Install upstart job:
    
     cp /usr/share/nova/$SERVICE.upstart \
        /etc/init/$SERVICE.conf
     initctl reload-configuration
     initctl start $SERVICE

 openstack-glance-api.upstart      |    8 ++++++++
 openstack-glance-registry.upstart |    8 ++++++++
 openstack-glance.spec             |   10 ++++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/openstack-glance-api.upstart b/openstack-glance-api.upstart
new file mode 100644
index 0000000..1539397
--- /dev/null
+++ b/openstack-glance-api.upstart
@@ -0,0 +1,8 @@
+description "OpenStack Image Service (code-named Glance) API server"
+
+start on stopped rc RUNLEVEL=[2345]
+stop on runlevel [S016]
+
+respawn
+
+exec su -s /bin/sh -c "exec /usr/bin/glance-api --config-file /etc/glance/glance-api.conf" glance
diff --git a/openstack-glance-registry.upstart b/openstack-glance-registry.upstart
new file mode 100644
index 0000000..eccae41
--- /dev/null
+++ b/openstack-glance-registry.upstart
@@ -0,0 +1,8 @@
+description "OpenStack Image Service (code-named Glance) Registry server"
+
+start on stopped rc RUNLEVEL=[2345]
+stop on runlevel [S016]
+
+respawn
+
+exec su -s /bin/sh -c "exec /usr/bin/glance-registry --config-file /etc/glance/glance-registry.conf" glance
diff --git a/openstack-glance.spec b/openstack-glance.spec
index 5789f77..3456351 100644
--- a/openstack-glance.spec
+++ b/openstack-glance.spec
@@ -8,7 +8,9 @@ License:          ASL 2.0
 URL:              http://glance.openstack.org
 Source0:          http://launchpad.net/glance/essex/2012.1/+download/glance-%{version}.tar.gz
 Source1:          openstack-glance-api.init
+Source100:        openstack-glance-api.upstart
 Source2:          openstack-glance-registry.init
+Source200:        openstack-glance-registry.upstart
 Source3:          openstack-glance.logrotate
 
 #
@@ -148,6 +150,7 @@ rm -f %{buildroot}%{_sysconfdir}/policy.json
 rm -f %{buildroot}/usr/share/doc/glance/README.rst
 
 # Setup directories
+install -d -m 755 %{buildroot}%{_datadir}/glance
 install -d -m 755 %{buildroot}%{_sharedstatedir}/glance/images
 
 # Config file
@@ -166,6 +169,10 @@ install -p -D -m 644 etc/policy.json %{buildroot}%{_sysconfdir}/glance/policy.js
 install -p -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/openstack-glance-api
 install -p -D -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/openstack-glance-registry
 
+# Install upstart jobs examples
+install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/glance/
+install -p -m 644 %{SOURCE200} %{buildroot}%{_datadir}/glance/
+
 # Logrotate config
 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-glance
 
@@ -208,6 +215,9 @@ fi
 %{_bindir}/glance-scrubber
 %{_initrddir}/openstack-glance-api
 %{_initrddir}/openstack-glance-registry
+%dir %{_datadir}/glance
+%{_datadir}/glance/openstack-glance-api.upstart
+%{_datadir}/glance/openstack-glance-registry.upstart
 %{_mandir}/man1/glance*.1.gz
 %dir %{_sysconfdir}/glance
 %config(noreplace) %attr(-, root, glance) %{_sysconfdir}/glance/glance-api.conf


More information about the scm-commits mailing list