[openstack-swift/el6-grizzly] Updating init and upstart scripts

Derek Higgins derekh at fedoraproject.org
Sat Apr 6 00:09:35 UTC 2013


commit ba617f22da466f6d460a5b45700cebb20ec99ff6
Author: Derek Higgins <derekh at redhat.com>
Date:   Sat Apr 6 00:36:56 2013 +0100

    Updating init and upstart scripts
    
    changes from zaitcev

 object-expirer.conf                       |   17 ++++++++
 openstack-swift-account-auditor.init      |    4 +-
 openstack-swift-account-reaper.init       |    4 +-
 openstack-swift-account-replicator.init   |    6 +--
 openstack-swift-account.init              |    2 -
 openstack-swift-container-auditor.init    |    6 +--
 openstack-swift-container-replicator.init |    6 +--
 openstack-swift-container-updater.init    |    6 +--
 openstack-swift-container.init            |    2 -
 openstack-swift-object-auditor.init       |    6 +--
 openstack-swift-object-expirer.init       |   32 ++++++++++++---
 openstack-swift-object-expirer.upstart    |    2 +-
 openstack-swift-object-replicator.init    |    6 +--
 openstack-swift-object-updater.init       |    6 +--
 openstack-swift-object.init               |    2 -
 openstack-swift-proxy.init                |    2 -
 openstack-swift.spec                      |   58 +++++++++++++++++++++++++++--
 17 files changed, 113 insertions(+), 54 deletions(-)
---
diff --git a/object-expirer.conf b/object-expirer.conf
new file mode 100644
index 0000000..b75963c
--- /dev/null
+++ b/object-expirer.conf
@@ -0,0 +1,17 @@
+[DEFAULT]
+
+[object-expirer]
+# auto_create_account_prefix = .
+
+[pipeline:main]
+pipeline = catch_errors cache proxy-server
+
+[app:proxy-server]
+use = egg:swift#proxy
+
+[filter:cache]
+use = egg:swift#memcache
+memcache_servers = 127.0.0.1:11211
+
+[filter:catch_errors]
+use = egg:swift#catch_errors
diff --git a/openstack-swift-account-auditor.init b/openstack-swift-account-auditor.init
index aa28dbb..6123fcf 100644
--- a/openstack-swift-account-auditor.init
+++ b/openstack-swift-account-auditor.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-account
+# Provides:          openstack-swift-account-auditor
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-account-reaper.init b/openstack-swift-account-reaper.init
index fd09a3b..2365fbb 100644
--- a/openstack-swift-account-reaper.init
+++ b/openstack-swift-account-reaper.init
@@ -9,7 +9,7 @@
 # Description:       Account reaper for swift.
 ### END INIT INFO
 
-# openstack-swift-account: swift account reaper
+# openstack-swift-account-reaper: swift account reaper
 #
 # chkconfig: - 98 02
 # description: Account reaper for swift.
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-account-replicator.init b/openstack-swift-account-replicator.init
index 39f670f..9d12d8e 100644
--- a/openstack-swift-account-replicator.init
+++ b/openstack-swift-account-replicator.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-account
+# Provides:          openstack-swift-account-replicator
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Account replicator for swift.
 ### END INIT INFO
 
-# openstack-swift-account: swift account replicator
+# openstack-swift-account-replicator: swift account replicator
 #
 # chkconfig: - 98 02
 # description: Account replicator for swift.
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-account.init b/openstack-swift-account.init
index fe0aafe..22dc376 100644
--- a/openstack-swift-account.init
+++ b/openstack-swift-account.init
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-container-auditor.init b/openstack-swift-container-auditor.init
index 89439e4..d07368b 100644
--- a/openstack-swift-container-auditor.init
+++ b/openstack-swift-container-auditor.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-container
+# Provides:          openstack-swift-container-auditor
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Container auditor for swift.
 ### END INIT INFO
 
-# openstack-swift-container: swift container auditor
+# openstack-swift-container-auditor: swift container auditor
 #
 # chkconfig: - 98 02
 # description: Container auditor for swift.
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-container-replicator.init b/openstack-swift-container-replicator.init
index 03bcc47..8b57a34 100644
--- a/openstack-swift-container-replicator.init
+++ b/openstack-swift-container-replicator.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-container
+# Provides:          openstack-swift-container-replicator
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Container replicator for swift.
 ### END INIT INFO
 
-# openstack-swift-container: swift container replicator
+# openstack-swift-container-replicator: swift container replicator
 #
 # chkconfig: - 98 02
 # description: Container replicator for swift.
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-container-updater.init b/openstack-swift-container-updater.init
index 6fea8a7..a079f53 100644
--- a/openstack-swift-container-updater.init
+++ b/openstack-swift-container-updater.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-container
+# Provides:          openstack-swift-container-updater
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Container updater for swift.
 ### END INIT INFO
 
-# openstack-swift-container: swift container updater
+# openstack-swift-container-updater: swift container updater
 #
 # chkconfig: - 98 02
 # description: Container updater for swift.
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-container.init b/openstack-swift-container.init
index 0341287..cd6d074 100644
--- a/openstack-swift-container.init
+++ b/openstack-swift-container.init
@@ -63,8 +63,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-object-auditor.init b/openstack-swift-object-auditor.init
index 7ce245e..318131b 100644
--- a/openstack-swift-object-auditor.init
+++ b/openstack-swift-object-auditor.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-object
+# Provides:          openstack-swift-object-auditor
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Object auditor for swift.
 ### END INIT INFO
 
-# openstack-swift-object: swift object auditor
+# openstack-swift-object-auditor: swift object auditor
 #
 # chkconfig: - 98 02
 # description: Object auditor for swift.
@@ -64,8 +64,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-object-expirer.init b/openstack-swift-object-expirer.init
index eb60b5d..0127872 100644
--- a/openstack-swift-object-expirer.init
+++ b/openstack-swift-object-expirer.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-object
+# Provides:          openstack-swift-object-expirer
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Object expirer for swift.
 ### END INIT INFO
 
-# openstack-swift-object: swift object expirer
+# openstack-swift-object-expirer: swift object expirer
 #
 # chkconfig: - 98 02
 # description: Object expirer for swift.
@@ -24,15 +24,35 @@ subserv="expirer"
 
 lockfile="/var/lock/subsys/openstack-swift-$name-$subserv"
 
+# The Object expirer defies the regular conventions enough that we have to
+# introspect into functions a bit. Fortunately all we need is a minute change
+# to swift_action.
+swift_action_expirer() {
+  retval=0
+  server="$1"
+  subserv="$2"
+  call="swift_$3"
+
+  if [[ -f "/etc/swift/$server-$subserv.conf" ]]; then
+    $call "$server-$subserv" \
+          "/etc/swift/$server-$subserv.conf" \
+          "/var/run/swift/$server-$subserv.pid"
+    [ $? -ne 0 ] && retval=1
+  else
+    retval=1
+  fi
+  return $retval
+}
+
 start() {
-    swift_action "$name" "$subserv" start
+    swift_action_expirer "$name" "$subserv" start
     retval=$?
     [ $retval -eq 0 ] && touch $lockfile
     return $retval
 }
 
 stop() {
-    swift_action "$name" "$subserv" stop
+    swift_action_expirer "$name" "$subserv" stop
     retval=$?
     [ $retval -eq 0 ] && rm -f $lockfile
     return $retval
@@ -44,7 +64,7 @@ restart() {
 }
 
 rh_status() {
-    swift_action "$name" "$subserv" status
+    swift_action_expirer "$name" "$subserv" status
 }
 
 rh_status_q() {
@@ -64,8 +84,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-object-expirer.upstart b/openstack-swift-object-expirer.upstart
index 23f2cbd..651ef40 100644
--- a/openstack-swift-object-expirer.upstart
+++ b/openstack-swift-object-expirer.upstart
@@ -5,4 +5,4 @@ stop on runlevel [S016]
 
 respawn
 
-exec su -s /bin/sh -c "exec /usr/bin/swift-object-expirer /etc/swift/object-server.conf" swift
+exec su -s /bin/sh -c "exec /usr/bin/swift-object-expirer /etc/swift/object-expirer.conf" swift
diff --git a/openstack-swift-object-replicator.init b/openstack-swift-object-replicator.init
index bd31a5e..29c96c4 100644
--- a/openstack-swift-object-replicator.init
+++ b/openstack-swift-object-replicator.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-object
+# Provides:          openstack-swift-object-replicator
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Object replicator for swift.
 ### END INIT INFO
 
-# openstack-swift-object: swift object replicator
+# openstack-swift-object-replicator: swift object replicator
 #
 # chkconfig: - 98 02
 # description: Object replicator for swift.
@@ -64,8 +64,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-object-updater.init b/openstack-swift-object-updater.init
index 6ae8ba8..af1dc5a 100644
--- a/openstack-swift-object-updater.init
+++ b/openstack-swift-object-updater.init
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          openstack-swift-object
+# Provides:          openstack-swift-object-updater
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
 # Default-Stop:      0 1 6
@@ -9,7 +9,7 @@
 # Description:       Object updater for swift.
 ### END INIT INFO
 
-# openstack-swift-object: swift object updater
+# openstack-swift-object-updater: swift object updater
 #
 # chkconfig: - 98 02
 # description: Object updater for swift.
@@ -64,8 +64,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-object.init b/openstack-swift-object.init
index 78061e4..f779567 100644
--- a/openstack-swift-object.init
+++ b/openstack-swift-object.init
@@ -64,8 +64,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift-proxy.init b/openstack-swift-proxy.init
index c9109e5..eca199b 100644
--- a/openstack-swift-proxy.init
+++ b/openstack-swift-proxy.init
@@ -64,8 +64,6 @@ case "$1" in
     restart)
         $1
         ;;
-    reload)
-        ;;
     status)
         rh_status
         ;;
diff --git a/openstack-swift.spec b/openstack-swift.spec
index eabc3f8..14a79ec 100644
--- a/openstack-swift.spec
+++ b/openstack-swift.spec
@@ -6,7 +6,7 @@
 
 Name:             openstack-swift
 Version:          1.8.0
-Release:          1%{?dist}
+Release:          2%{?dist}
 Summary:          OpenStack Object Storage (swift)
 
 Group:            Development/Languages
@@ -46,6 +46,7 @@ Source513:        %{name}-object-replicator.init
 Source514:        %{name}-object-updater.init
 Source6:          %{name}-proxy.init
 Source61:         proxy-server.conf
+Source62:         object-expirer.conf
 Source600:        %{name}-proxy.upstart
 Source7:          swift.conf
 
@@ -248,6 +249,7 @@ install -p -D -m 660 %{SOURCE22} %{buildroot}%{_sysconfdir}/swift/account-server
 install -p -D -m 660 %{SOURCE42} %{buildroot}%{_sysconfdir}/swift/container-server.conf
 install -p -D -m 660 %{SOURCE52} %{buildroot}%{_sysconfdir}/swift/object-server.conf
 install -p -D -m 660 %{SOURCE61} %{buildroot}%{_sysconfdir}/swift/proxy-server.conf
+install -p -D -m 660 %{SOURCE62} %{buildroot}%{_sysconfdir}/swift/object-expirer.conf
 install -p -D -m 660 %{SOURCE7} %{buildroot}%{_sysconfdir}/swift/swift.conf
 # Install pid directory
 install -d -m 755 %{buildroot}%{_localstatedir}/run/swift
@@ -255,13 +257,16 @@ install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/account-server
 install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/container-server
 install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/object-server
 install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/proxy-server
+# Install recon directory
+install -d -m 755 %{buildroot}%{_localstatedir}/cache/swift
 # man pages
 install -d -m 755 %{buildroot}%{_mandir}/man5
 for m in doc/manpages/*.5; do
   install -p -m 0644 $m %{buildroot}%{_mandir}/man5
 done
 install -d -m 755 %{buildroot}%{_mandir}/man1
-for m in doc/manpages/*.1; do
+# Matching swift-* avoids swift.1, moved to python-swiftclient, bz#904353
+for m in doc/manpages/swift-*.1; do
   install -p -m 0644 $m %{buildroot}%{_mandir}/man1
 done
 
@@ -277,58 +282,98 @@ exit 0
 
 %post account
 /sbin/chkconfig --add openstack-swift-account
+/sbin/chkconfig --add openstack-swift-account-auditor
+/sbin/chkconfig --add openstack-swift-account-reaper
+/sbin/chkconfig --add openstack-swift-account-replicator
 
 %preun account
 if [ $1 = 0 ] ; then
     /sbin/service openstack-swift-account stop >/dev/null 2>&1
+    /sbin/service openstack-swift-account-auditor stop >/dev/null 2>&1
+    /sbin/service openstack-swift-account-reaper stop >/dev/null 2>&1
+    /sbin/service openstack-swift-account-replicator stop >/dev/null 2>&1
     /sbin/chkconfig --del openstack-swift-account
+    /sbin/chkconfig --del openstack-swift-account-auditor
+    /sbin/chkconfig --del openstack-swift-account-reaper
+    /sbin/chkconfig --del openstack-swift-account-replicator
 fi
 
 %postun account
 if [ "$1" -ge "1" ] ; then
     /sbin/service openstack-swift-account condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-account-auditor condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-account-reaper condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-account-replicator condrestart >/dev/null 2>&1 || :
 fi
 
 %post container
 /sbin/chkconfig --add openstack-swift-container
+/sbin/chkconfig --add openstack-swift-container-auditor
+/sbin/chkconfig --add openstack-swift-container-replicator
+/sbin/chkconfig --add openstack-swift-container-updater
 
 %preun container
 if [ $1 = 0 ] ; then
     /sbin/service openstack-swift-container stop >/dev/null 2>&1
+    /sbin/service openstack-swift-container-auditor stop >/dev/null 2>&1
+    /sbin/service openstack-swift-container-replicator stop >/dev/null 2>&1
+    /sbin/service openstack-swift-container-updater stop >/dev/null 2>&1
     /sbin/chkconfig --del openstack-swift-container
+    /sbin/chkconfig --del openstack-swift-container-auditor
+    /sbin/chkconfig --del openstack-swift-container-replicator
+    /sbin/chkconfig --del openstack-swift-container-updater
 fi
 
 %postun container
 if [ "$1" -ge "1" ] ; then
     /sbin/service openstack-swift-container condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-container-auditor condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-container-replicator condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-container-updater condrestart >/dev/null 2>&1 || :
 fi
 
 %post object
 /sbin/chkconfig --add openstack-swift-object
+/sbin/chkconfig --add openstack-swift-object-auditor
+/sbin/chkconfig --add openstack-swift-object-replicator
+/sbin/chkconfig --add openstack-swift-object-updater
 
 %preun object
 if [ $1 = 0 ] ; then
     /sbin/service openstack-swift-object stop >/dev/null 2>&1
+    /sbin/service openstack-swift-object-auditor stop >/dev/null 2>&1
+    /sbin/service openstack-swift-object-replicator stop >/dev/null 2>&1
+    /sbin/service openstack-swift-object-updater stop >/dev/null 2>&1
     /sbin/chkconfig --del openstack-swift-object
+    /sbin/chkconfig --del openstack-swift-object-auditor
+    /sbin/chkconfig --del openstack-swift-object-replicator
+    /sbin/chkconfig --del openstack-swift-object-updater
 fi
 
 %postun object
 if [ "$1" -ge "1" ] ; then
     /sbin/service openstack-swift-object condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-object-auditor condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-object-replicator condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-object-updater condrestart >/dev/null 2>&1 || :
 fi
 
 %post proxy
 /sbin/chkconfig --add openstack-swift-proxy
+/sbin/chkconfig --add openstack-swift-object-expirer
 
 %preun proxy
 if [ $1 = 0 ] ; then
     /sbin/service openstack-swift-proxy stop >/dev/null 2>&1
+    /sbin/service openstack-swift-object-expirer stop >/dev/null 2>&1
     /sbin/chkconfig --del openstack-swift-proxy
+    /sbin/chkconfig --del openstack-swift-object-expirer
 fi
 
 %postun proxy
 if [ "$1" -ge "1" ] ; then
     /sbin/service openstack-swift-proxy condrestart >/dev/null 2>&1 || :
+    /sbin/service openstack-swift-object-expirer condrestart >/dev/null 2>&1 || :
 fi
 
 %files
@@ -348,6 +393,7 @@ fi
 %dir %{_sysconfdir}/swift
 %config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/swift.conf
 %dir %attr(0755, swift, root) %{_localstatedir}/run/swift
+%dir %attr(0755, swift, root) %{_localstatedir}/cache/swift
 %dir %{python_sitelib}/swift
 %{_bindir}/swift-account-audit
 %{_bindir}/swift-bench
@@ -365,6 +411,7 @@ fi
 %{_bindir}/swift-temp-url
 %{python_sitelib}/swift/*.py*
 %{python_sitelib}/swift/common
+%{python_sitelib}/swift/obj
 %{python_sitelib}/swift-%{version}-*.egg-info
 
 %files account
@@ -432,11 +479,10 @@ fi
 %{_bindir}/swift-object-replicator
 %{_bindir}/swift-object-server
 %{_bindir}/swift-object-updater
-%{python_sitelib}/swift/obj
 
 %files proxy
 %defattr(-,root,root,-)
-%doc etc/proxy-server.conf-sample
+%doc etc/proxy-server.conf-sample etc/object-expirer.conf-sample
 %dir %{_initrddir}/%{name}-object-expirer
 %dir %{_initrddir}/%{name}-proxy
 %{_datadir}/%{name}/%{name}-object-expirer.upstart
@@ -447,6 +493,7 @@ fi
 %{_mandir}/man1/swift-proxy-server.1*
 %dir %{_sysconfdir}/swift/proxy-server
 %config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/proxy-server.conf
+%config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/object-expirer.conf
 %dir %attr(0755, swift, root) %{_localstatedir}/run/swift/proxy-server
 %{_bindir}/swift-object-expirer
 %{_bindir}/swift-proxy-server
@@ -457,6 +504,9 @@ fi
 %doc LICENSE doc/build/html
 
 %changelog
+* Sat Apr 06 2013 Derek Higgins <derekh at redhat.com> - 1.8.0-2
+- Updating init and upstart scripts, changes from zaitcev
+
 * Fri Apr 05 2013 Derek Higgins <derekh at redhat.com> - 1.8.0-1
 - Grizzly update to swift 1.8.0
 


More information about the scm-commits mailing list