Issue #8346 has been updated by Konstantin Ryabitsev.
Status changed from Needs More Information to Closed
I have a similar issue with a service running on rhel6, except the service is
certmaster. Here is the output you requested:
<pre>
[root@logs init.d]# /etc/init.d/certmaster status
certmaster is not running
[root@logs init.d]# echo $?
3
[root@logs init.d]# puppet resource service certmaster -d
debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not
exist
debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does
not exist
debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not
exist
debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not
exist
debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not
exist
debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does
not exist
debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not
exist
debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not
exist
debug: Service[certmaster](provider=redhat): Executing '/sbin/service
certmaster status'
debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/chkconfig
certmaster'
service { 'certmaster':
ensure => 'running',
enable => 'false',
}
[root@logs init.d]# puppet resource service certmaster hasstatus=true -d
debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not
exist
debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does
not exist
debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not
exist
debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not
exist
debug: Loaded state in 0.00 seconds
debug: Service[certmaster](provider=redhat): Executing '/sbin/service
certmaster status'
debug: Finishing transaction 70363726088120
debug: Storing state
debug: Stored state in 0.03 seconds
debug: Service[certmaster](provider=redhat): Executing '/sbin/service
certmaster status'
service { 'certmaster':
ensure => 'running',
}
[root@logs init.d]# /etc/init.d/puppet status
puppetd (pid 31557) is running...
[root@logs init.d]# echo $?
0
[root@logs init.d]# puppet resource service puppet -d
debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not
exist
debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does
not exist
debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not
exist
debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not
exist
debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not
exist
debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does
not exist
debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not
exist
debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not
exist
debug: Service[puppet](provider=redhat): Executing '/sbin/service puppet status'
debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/chkconfig puppet'
service { 'puppet':
ensure => 'running',
enable => 'true',
}
[root@logs init.d]# puppet resource service puppet hasstatus=true -d
debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not
exist
debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does
not exist
debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not
exist
debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not
exist
debug: Loaded state in 0.00 seconds
debug: Service[puppet](provider=redhat): Executing '/sbin/service puppet status'
debug: Finishing transaction 70100653891600
debug: Storing state
debug: Stored state in 0.05 seconds
debug: Service[puppet](provider=redhat): Executing '/sbin/service puppet status'
service { 'puppet':
ensure => 'running',
}
</pre>
----------------------------------------
Bug #8346: services falsely presumed running on redhat
https://projects.puppetlabs.com/issues/8346#change-55096
Author: Chris Phillips
Status: Closed
Priority: Normal
Assignee:
Category: service
Target version:
Affected Puppet version: 2.6.7
Keywords: service status stopped restart
Branch:
I have a number of systems which are frequently having problems centering
around various services being believed to be running by puppet when they are
actually stopped. I have not seen any examples of the opposite being true
however.
Two examples:
I use a nagios check to run puppet, so want to ensure the puppet client service
is NOT running. the manifest I use to do this is:
service { "puppet":
ensure => stopped,
enable => false,
subscribe => File["/etc/puppet/puppet.conf"],
hasrestart => true,
hasstatus => true,
}
And this is normally working just fine, however sometimes a client starts to
believe that the service IS running, despite there being NO puppet processes
running other than the current one-shot one executing the manifests. This
happens if running from a cron job, a nagios check or "puppetd -tv" from
command line directly. "/etc/init.d/puppet status" returns that the service is
not running, with the right exit code (3). Puppet output on continual manual
runs:
notice: /Stage[first]/Puppet/Service[puppet]/ensure: ensure changed 'running'
to 'stopped'
notice: Finished catalog run in 13.93 seconds
again and again forever until the manifest is changed, to, for example, say it
should be running, let that apply, and then revert back to stopped.
Similarly I need func running on all boxes, sometimes it will stop during a
logrotate for unknown reasons, and puppet will refuse to start it despite
everything saying it is stopped.
service { "funcd":
ensure => running,
enable => true,
subscribe => File["/etc/func/minion.conf"],
require => Package["func"],
hasrestart => true,
hasstatus => false
}
Again this generally works, but over this weekend 9 boxes has func fail on
them, there are NO func processes running, and "/etc/init.d/funcd status"
confirms this (textually and exist code 3), and this manifest generally works
fine.
This may possibly be related to the use of the hasstatus parameter, it *seemed*
to improve the func service check, but doesn't influence the puppet service
being falsely believed to be running. Or the repetitive nature suggests
something is possibly cached on the client?
This is on 2.6.7 on rhel5 & 6, i386 and x86_64.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.