[Pkg-puppet-devel] Bug#584481: puppet: Fix init service provider to support upstart jobs
Mathias Gug
mathiaz at ubuntu.com
Thu Jun 3 20:31:59 UTC 2010
Package: puppet
Version: 0.25.4-2ubuntu6
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu maverick ubuntu-patch
In Ubuntu we've applied to following patch:
* Fix init service provider to correctly check the status of services
using upstart jobs (LP: #551544).
This is a temporary workaround as long as initctl (upstart) doesn't
properly return exit code for the status command. The long term option
is to write a native upstart provider for puppet. For the time being
this fix helps in supporting the status option in puppet.
-- System Information:
Debian Release: squeeze/sid
APT prefers lucid-updates
APT policy: (500, 'lucid-updates'), (500, 'lucid-security'), (500, 'lucid')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-22-generic (SMP w/4 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages puppet depends on:
ii adduser 3.112ubuntu1 add and remove users and groups
ii facter 1.5.6-2ubuntu2 a library for retrieving facts fro
ii libopenssl-ruby 4.2 OpenSSL interface for Ruby
ii libruby [libxmlrpc-ruby] 4.2 Libraries necessary to run Ruby 1.
ii libshadow-ruby1.8 1.4.1-8build1 Interface of shadow password for R
ii libxmlrpc-ruby 4.2 transitional dummy package
ii lsb-base 4.0-0ubuntu8 Linux Standard Base 4.0 init scrip
ii puppet-common 0.25.4-2ubuntu6 common files for puppet and puppet
ii ruby1.8 1.8.7.249-2 Interpreter of object-oriented scr
Versions of packages puppet recommends:
ii libaugeas-ruby1.8 0.2.0-2ubuntu3 Augeas bindings for the Ruby langu
ii rdoc 4.2 Generate documentation from ruby s
Versions of packages puppet suggests:
ii etckeeper 0.41ubuntu3 store /etc in git, mercurial, bzr
pn puppet-el <none> (no description available)
ii vim-puppet 0.25.4-2ubuntu6 Vim syntax highlighting for puppet
-- no debconf information
-------------- next part --------------
=== modified file 'lib/puppet/provider/service/init.rb'
--- lib/puppet/provider/service/init.rb 2010-01-09 06:10:39 +0000
+++ lib/puppet/provider/service/init.rb 2010-06-03 18:54:20 +0000
@@ -134,7 +134,15 @@
# we just return that; otherwise, we return false, which causes it to
# fallback to other mechanisms.
def statuscmd
- (@resource[:hasstatus] == :true) && [initscript, :status]
+ if @resource[:hasstatus] == :true then
+ # Workaround the fact that initctl status command doesn't return
+ # proper exit codes. Can be removed once LP: #552786 is fixed.
+ if File.symlink?(initscript) && File.readlink(initscript) == "/lib/init/upstart-job" then
+ ['sh', '-c', "LANG=C invoke-rc.d #{File::basename(initscript)} status | grep -q '^#{File::basename(initscript)}.*running'" ]
+ else
+ [initscript, :status ]
+ end
+ end
end
end
More information about the Pkg-puppet-devel
mailing list