Issue #21378 has been reported by John Morrissey.
----------------------------------------
Bug #21378: Setting a status command on a service calls the status command even
when hasstatus=true
https://projects.puppetlabs.com/issues/21378
* Author: John Morrissey
* Status: Unreviewed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* Affected Puppet version:
* Keywords:
* Branch:
----------------------------------------
The agent runs a service's status command even when hasstatus is explicitly set
to true on that service. Based on the type reference, it seems setting
hasstatus=true should force the agent to use the service's init script instead
of the custom status command.
provider/service/redhat.rb seems like it's doing the right thing, so I'm not
sure where the problem lies.
--
Declare whether the service’s init script has a functional status command;
defaults to true. This attribute’s default value changed in Puppet 2.7.0.
[...]
If a service’s init script does not support any kind of status command, you
should set hasstatus to false and either provide a specific command using the
status attribute or expect that Puppet will look for the service name in the
process table.
--
[jwm@hsph02:pts/1 ~> lsb_release -d
Description: CentOS release 5.7 (Final)
[jwm@hsph02:pts/1 ~> rpm -q puppet
puppet-3.2.2-1.el5
[jwm@hsph02:pts/1 ~> cat service-status.pp
service { 'snmpd':
ensure => running,
hasstatus => true,
status => 'touch /tmp/foo',
}
[jwm@hsph02:pts/1 ~> sudo puppet apply -vd service-status.pp
[...]
Debug: Loaded state in 0.23 seconds
Info: Applying configuration version '1371763702'
[...]
Debug: Executing 'touch /tmp/foo'
--
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.