[openstack-swift] Allow for multiple instances of systemd services

Alan Pevec apevec at fedoraproject.org
Tue Mar 20 22:54:58 UTC 2012


commit 6a53f5b1716294a13ec4d8e3ea0d5ab88688ab3e
Author: Alan Pevec <apevec at redhat.com>
Date:   Tue Mar 20 23:40:19 2012 +0100

    Allow for multiple instances of systemd services
    
    For SAIO "swift all in one" installation.
    
    rhbz#805149

 openstack-swift-account at .service   |   11 +++++++++++
 openstack-swift-container at .service |   11 +++++++++++
 openstack-swift-object at .service    |   11 +++++++++++
 openstack-swift.spec               |   11 ++++++++++-
 4 files changed, 43 insertions(+), 1 deletions(-)
---
diff --git a/openstack-swift-account at .service b/openstack-swift-account at .service
new file mode 100644
index 0000000..cae48c7
--- /dev/null
+++ b/openstack-swift-account at .service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenStack Object Storage (swift) - Account Server instance %I
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=swift
+ExecStart=/usr/bin/swift-account-server /etc/swift/account-server/%i.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack-swift-container at .service b/openstack-swift-container at .service
new file mode 100644
index 0000000..4f51e3f
--- /dev/null
+++ b/openstack-swift-container at .service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenStack Object Storage (swift) - Container Server instance %I
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=swift
+ExecStart=/usr/bin/swift-container-server /etc/swift/container-server/%i.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack-swift-object at .service b/openstack-swift-object at .service
new file mode 100644
index 0000000..172e322
--- /dev/null
+++ b/openstack-swift-object at .service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenStack Object Storage (swift) - Object Server instance %I
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=swift
+ExecStart=/usr/bin/swift-object-server /etc/swift/object-server/%i.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack-swift.spec b/openstack-swift.spec
index b1f9b38..9170dbe 100644
--- a/openstack-swift.spec
+++ b/openstack-swift.spec
@@ -4,7 +4,7 @@
 
 Name:             openstack-swift
 Version:          1.4.7
-Release:          1%{?dist}
+Release:          2%{?dist}
 Summary:          OpenStack Object Storage (swift)
 
 Group:            Development/Languages
@@ -12,8 +12,11 @@ License:          ASL 2.0
 URL:              http://launchpad.net/swift
 Source0:          http://launchpad.net/swift/essex/%{version}/+download/swift-%{version}.tar.gz
 Source2:          %{name}-account.service
+Source21:         %{name}-account at .service
 Source4:          %{name}-container.service
+Source41:         %{name}-container at .service
 Source5:          %{name}-object.service
+Source51:         %{name}-object at .service
 Source6:          %{name}-proxy.service
 Source20:         %{name}.tmpfs
 BuildRoot:        %{_tmppath}/swift-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -150,8 +153,11 @@ rm -rf %{buildroot}
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
 # systemd units
 install -p -D -m 755 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}-account.service
+install -p -D -m 755 %{SOURCE21} %{buildroot}%{_unitdir}/%{name}-account at .service
 install -p -D -m 755 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}-container.service
+install -p -D -m 755 %{SOURCE41} %{buildroot}%{_unitdir}/%{name}-container at .service
 install -p -D -m 755 %{SOURCE5} %{buildroot}%{_unitdir}/%{name}-object.service
+install -p -D -m 755 %{SOURCE51} %{buildroot}%{_unitdir}/%{name}-object at .service
 install -p -D -m 755 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}-proxy.service
 # Remove tests
 rm -fr %{buildroot}/%{python_sitelib}/test
@@ -324,6 +330,7 @@ fi
 %defattr(-,root,root,-)
 %doc etc/account-server.conf-sample
 %dir %{_unitdir}/%{name}-account.service
+%dir %{_unitdir}/%{name}-account at .service
 %dir %{_sysconfdir}/swift/account-server
 %{_bindir}/swift-account-auditor
 %{_bindir}/swift-account-reaper
@@ -336,6 +343,7 @@ fi
 %defattr(-,root,root,-)
 %doc etc/container-server.conf-sample
 %dir %{_unitdir}/%{name}-container.service
+%dir %{_unitdir}/%{name}-container at .service
 %dir %{_sysconfdir}/swift/container-server
 %{_bindir}/swift-container-auditor
 %{_bindir}/swift-container-server
@@ -348,6 +356,7 @@ fi
 %defattr(-,root,root,-)
 %doc etc/object-server.conf-sample etc/rsyncd.conf-sample
 %dir %{_unitdir}/%{name}-object.service
+%dir %{_unitdir}/%{name}-object at .service
 %dir %{_sysconfdir}/swift/object-server
 %{_bindir}/swift-object-auditor
 %{_bindir}/swift-object-info


More information about the scm-commits mailing list