From 403a88a05f4327390bf5796657ce2ca9cfca7980 Mon Sep 17 00:00:00 2001 From: Sergio Rubio Date: Thu, 20 Sep 2012 11:10:18 +0200 Subject: [PATCH] Manage missing Swift storage server services Before this fix the following services where missing: root@swift-storage-01:~# swift-init status all|grep ^No No container-updater running No account-auditor running No object-auditor running No object-expirer running No container-auditor running No account-reaper running No container-sync running No object-updater running After this commit: root@swift-storage-01:/etc/init# swift-init status all|grep ^No No proxy-server running No object-expirer running It's OK for the proxy-server to be stopped since it's a storage . You only need to manage one object-expirer per cluster, so this not place to manage it either. See: http://docs.openstack.org/developer/swift/overview_expiring_objects.html --- files/swift-container-sync.conf.upstart | 20 ++++++++++++++++++++ manifests/storage/account.pp | 15 +++++++++++++++ manifests/storage/container.pp | 24 ++++++++++++++++++++++++ manifests/storage/object.pp | 14 ++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 files/swift-container-sync.conf.upstart diff --git a/files/swift-container-sync.conf.upstart b/files/swift-container-sync.conf.upstart new file mode 100644 index 00000000..54b010cf --- /dev/null +++ b/files/swift-container-sync.conf.upstart @@ -0,0 +1,20 @@ +# swift-container-sync - SWIFT Container Sync +# +# The swift container sync. + +description "SWIFT Container Sync" +author "Sergio Rubio " + +start on runlevel [2345] +stop on runlevel [016] + +pre-start script + if [ -f "/etc/swift/container-server.conf" ]; then + exec /usr/bin/swift-init container-sync start + else + exit 1 + fi +end script + +post-stop exec /usr/bin/swift-init container-sync stop + diff --git a/manifests/storage/account.pp b/manifests/storage/account.pp index 08ba9d40..ec68a945 100644 --- a/manifests/storage/account.pp +++ b/manifests/storage/account.pp @@ -4,4 +4,19 @@ class swift::storage::account( swift::storage::generic { 'account': package_ensure => $package_ensure, } + + # Not tested in other distros, safety measure + if $operatingsystem == 'Ubuntu' { + service { 'swift-account-reaper': + ensure => running, + enable => true, + provider => $::swift::params::service_provider, + } + + service { 'swift-account-auditor': + ensure => running, + enable => true, + provider => $::swift::params::service_provider, + } + } } diff --git a/manifests/storage/container.pp b/manifests/storage/container.pp index 823cc9e7..dd2dcb4e 100644 --- a/manifests/storage/container.pp +++ b/manifests/storage/container.pp @@ -4,4 +4,28 @@ class swift::storage::container( swift::storage::generic { 'container': package_ensure => $package_ensure } + + # Not tested in other distros, safety measure + if $operatingsystem == 'Ubuntu' { + service { 'swift-container-updater': + ensure => running, + enable => true, + provider => $::swift::params::service_provider, + } + service { 'swift-container-auditor': + ensure => running, + enable => true, + provider => $::swift::params::service_provider, + } + # The following service conf is missing in Ubunty 12.04 + file { '/etc/init/swift-container-sync.conf': + source => 'puppet:///modules/swift/swift-container-sync.conf.upstart', + } + service { 'swift-container-sync': + ensure => running, + enable => true, + provider => $::swift::params::service_provider, + require => File['/etc/init/swift-container-sync.conf'] + } + } } diff --git a/manifests/storage/object.pp b/manifests/storage/object.pp index c9bc7309..440044a1 100644 --- a/manifests/storage/object.pp +++ b/manifests/storage/object.pp @@ -4,4 +4,18 @@ class swift::storage::object( swift::storage::generic { 'object': package_ensure => $package_ensure } + + # Not tested in other distros, safety measure + if $operatingsystem == 'Ubuntu' { + service { 'swift-object-updater': + ensure => running, + enable => true, + provider => $::swift::params::service_provider, + } + service { 'swift-object-auditor': + ensure => running, + enable => true, + provider => $::swift::params::service_provider, + } + } }