Add custom upstart scripts

In the current trunk PPA for oneiric (which is what
I am using for testing), the upstart files seem
to have a problem where they only will start the
swift servers if the file:
  /etc/swift/<server_name>-server

exists. Raised as issue: 931893
in Launchpad.

This commit adds puppet code to deploy custom
upstart scripts that have fixed this issue.
This commit is contained in:
Dan Bode 2012-02-14 14:03:25 -08:00
parent cf04472bfd
commit 3457ff5897
4 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# Temporarily managed by Puppet until
# 931893 is resolved
# swift-account-server - SWIFT Object Server
#
# The swift account server.
description "SWIFT Account Server"
author "Marc Cluet <marc.cluet@ubuntu.com>"
start on runlevel [2345]
stop on runlevel [016]
pre-start script
if [ $(find /etc/swift/account-server/ -type f 2>/dev/null | wc -l) -gt 0 ]; then
exec /usr/bin/swift-init account-server start
elif [ -f /etc/swift/account-server.conf ]; then
exec /usr/bin/swift-init account-server start
else
exit 1
fi
end script
post-stop exec /usr/bin/swift-init account-server stop

View File

@ -0,0 +1,23 @@
# Temporarily managed by Puppet until
# 931893 is resolved
# swift-container-server - SWIFT Object Server
#
# The swift container server.
description "SWIFT Container Server"
author "Marc Cluet <marc.cluet@ubuntu.com>"
start on runlevel [2345]
stop on runlevel [016]
pre-start script
if [ $(find /etc/swift/container-server/ -type f 2>/dev/null | wc -l) -gt 0 ]; then
exec /usr/bin/swift-init container-server start
elif [ -f /etc/swift/container-server.conf ]; then
exec /usr/bin/swift-init container-server start
else
exit 1
fi
end script
post-stop exec /usr/bin/swift-init container-server stop

View File

@ -0,0 +1,23 @@
# Temporarily managed by Puppet until
# 931893 is resolved
# swift-object-server - SWIFT Object Server
#
# The swift object server.
description "SWIFT Object Server"
author "Marc Cluet <marc.cluet@ubuntu.com>"
start on runlevel [2345]
stop on runlevel [016]
pre-start script
if [ $(find /etc/swift/object-server/ -type f 2>/dev/null | wc -l) -gt 0 ]; then
exec /usr/bin/swift-init object-server start
elif [ -f /etc/swift/object-server.conf ]; then
exec /usr/bin/swift-init object-server start
else
exit 1
fi
end script
post-stop exec /usr/bin/swift-init object-server stop

View File

@ -100,4 +100,17 @@ class swift::storage(
service { 'swift-object':
provider => 'upstart',
}
define upstart() {
file { "/etc/init/swift-${name}.conf":
mode => '0644',
owner => 'root',
group => 'root',
source => "puppet:///modules/swift/swift-${name}.conf.upstart",
before => Service["swift-${name}"],
}
}
swift::storage::upstart { ['object', 'container', 'account']: }
}