[openstack-swift/el6] add upstart jobs for RHEL6
Alan Pevec
apevec at fedoraproject.org
Mon Jun 25 21:01:21 UTC 2012
commit 75f69ad3863fa2e85a9c10674eb52532ae37196f
Author: Alan Pevec <apevec at redhat.com>
Date: Mon Jun 25 22:42:38 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/openstack-swift/$SERVICE.upstart \
/etc/init/$SERVICE.conf
initctl reload-configuration
initctl start $SERVICE
openstack-swift-account.upstart | 8 ++++++++
openstack-swift-container.upstart | 8 ++++++++
openstack-swift-object.upstart | 8 ++++++++
openstack-swift-proxy.upstart | 8 ++++++++
openstack-swift.spec | 13 +++++++++++++
5 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/openstack-swift-account.upstart b/openstack-swift-account.upstart
new file mode 100644
index 0000000..69caed9
--- /dev/null
+++ b/openstack-swift-account.upstart
@@ -0,0 +1,8 @@
+description "OpenStack Object Storage (swift) - Account Server"
+
+start on stopped rc RUNLEVEL=[2345]
+stop on runlevel [S016]
+
+respawn
+
+exec su -s /bin/sh -c "exec /usr/bin/swift-account-server /etc/swift/account-server.conf" swift
diff --git a/openstack-swift-container.upstart b/openstack-swift-container.upstart
new file mode 100644
index 0000000..8c30923
--- /dev/null
+++ b/openstack-swift-container.upstart
@@ -0,0 +1,8 @@
+description "OpenStack Object Storage (swift) - Container Server"
+
+start on stopped rc RUNLEVEL=[2345]
+stop on runlevel [S016]
+
+respawn
+
+exec su -s /bin/sh -c "exec /usr/bin/swift-container-server /etc/swift/container-server.conf" swift
diff --git a/openstack-swift-object.upstart b/openstack-swift-object.upstart
new file mode 100644
index 0000000..c24248f
--- /dev/null
+++ b/openstack-swift-object.upstart
@@ -0,0 +1,8 @@
+description "OpenStack Object Storage (swift) - Object Server"
+
+start on stopped rc RUNLEVEL=[2345]
+stop on runlevel [S016]
+
+respawn
+
+exec su -s /bin/sh -c "exec /usr/bin/swift-object-server /etc/swift/object-server.conf" swift
diff --git a/openstack-swift-proxy.upstart b/openstack-swift-proxy.upstart
new file mode 100644
index 0000000..8ab1c7d
--- /dev/null
+++ b/openstack-swift-proxy.upstart
@@ -0,0 +1,8 @@
+description "OpenStack Object Storage (swift) - Proxy Server"
+
+start on stopped rc RUNLEVEL=[2345]
+stop on runlevel [S016]
+
+respawn
+
+exec su -s /bin/sh -c "exec /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf" swift
diff --git a/openstack-swift.spec b/openstack-swift.spec
index d6bb80b..91002bf 100644
--- a/openstack-swift.spec
+++ b/openstack-swift.spec
@@ -13,9 +13,13 @@ URL: http://launchpad.net/swift
Source0: http://launchpad.net/swift/essex/%{version}/+download/swift-%{version}.tar.gz
Source1: %{name}-functions
Source2: %{name}-account.init
+Source200: %{name}-account.upstart
Source4: %{name}-container.init
+Source400: %{name}-container.upstart
Source5: %{name}-object.init
+Source500: %{name}-object.upstart
Source6: %{name}-proxy.init
+Source600: %{name}-proxy.upstart
Patch0: openstack-swift-newdeps.patch
Patch1: openstack-swift-docmod.patch
Patch2: openstack-swift-nonet.patch
@@ -159,6 +163,11 @@ rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
# Init helper functions
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_datarootdir}/%{name}/functions
+# Install upstart jobs examples
+install -p -m 644 %{SOURCE200} %{buildroot}%{_datadir}/%{name}
+install -p -m 644 %{SOURCE400} %{buildroot}%{_datadir}/%{name}
+install -p -m 644 %{SOURCE500} %{buildroot}%{_datadir}/%{name}
+install -p -m 644 %{SOURCE600} %{buildroot}%{_datadir}/%{name}
# Init scripts
install -p -D -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/%{name}-account
install -p -D -m 755 %{SOURCE4} %{buildroot}%{_initrddir}/%{name}-container
@@ -277,6 +286,7 @@ fi
%defattr(-,root,root,-)
%doc etc/account-server.conf-sample
%dir %{_initrddir}/%{name}-account
+%{_datadir}/%{name}/%{name}-account.upstart
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/account-server
%dir %{_sysconfdir}/swift/account-server
%{_bindir}/swift-account-auditor
@@ -290,6 +300,7 @@ fi
%defattr(-,root,root,-)
%doc etc/container-server.conf-sample
%dir %{_initrddir}/%{name}-container
+%{_datadir}/%{name}/%{name}-container.upstart
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/container-server
%dir %{_sysconfdir}/swift/container-server
%{_bindir}/swift-container-auditor
@@ -303,6 +314,7 @@ fi
%defattr(-,root,root,-)
%doc etc/object-server.conf-sample etc/rsyncd.conf-sample
%dir %{_initrddir}/%{name}-object
+%{_datadir}/%{name}/%{name}-object.upstart
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/object-server
%dir %{_sysconfdir}/swift/object-server
%{_bindir}/swift-object-auditor
@@ -316,6 +328,7 @@ fi
%defattr(-,root,root,-)
%doc etc/proxy-server.conf-sample
%dir %{_initrddir}/%{name}-proxy
+%{_datadir}/%{name}/%{name}-proxy.upstart
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/proxy-server
%dir %{_sysconfdir}/swift/proxy-server
%{_bindir}/swift-proxy-server
More information about the scm-commits
mailing list