Issue #13980 has been updated by Stuart Browne.
I've got the same issue.
On CentOS6, the service 'cpuspeed' is (by default) enabled in run-levels 1-5:
# Default-Start: 1 2 3 4 5
Using:
service { 'cpuspeed':
ensure => stopped,
enable => false
}
Only disables the service in run-levels 2, 3, 4 and 5. It left run-level 1
enabled.
Using if 'enable => false', it should be disabling all run-levels:
# chkconfig --level 0123456 cpuspeed off
Perhaps the redhat service provider can be updated to include this blanket
level specifier.
A separate reuqest is around to give more fine-grained control over the
run-levels available for a given service. This bug isn't asking for that.
----------------------------------------
Bug #13980: Services not disabling completely on RHEL 5/6
https://projects.puppetlabs.com/issues/13980#change-64097
Author: Ashley Penney
Status: Needs Decision
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords:
Branch:
We encountered a situation with puppet where having:
<pre>
service { 'rhnsd':
ensure => false,
enable => false,
}
</pre>
Wasn't enough to fully disable a service. It remained "on" for runlevel 2.
This caused us to fail some compliance tests and so I started digging deeper
into this. It seems that the provider/service/redhat.rb uses /sbin/chkconfig
service to see if a service is enabled or disabled. It looks like this uses
345 to determine if a service is enabled or not:
<pre>
[root@gws1 ~]# /sbin/chkconfig --levels 2 yum-updatesd on
[root@gws1 ~]# /sbin/chkconfig yum-updatesd --list
yum-updatesd 0:off 1:off 2:on 3:off 4:off 5:off 6:off
[root@gws1 ~]# /sbin/chkconfig yum-updatesd
[root@gws1 ~]# echo $?
1
[root@gws1 ~]# /sbin/chkconfig yum-updatesd off
[root@gws1 ~]# /sbin/chkconfig yum-updatesd --list
yum-updatesd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@gws1 ~]# /sbin/chkconfig yum-updatesd
[root@gws1 ~]# echo $?
1
[root@gws1 ~]# /sbin/chkconfig --levels 345 yum-updatesd on
[root@gws1 ~]# /sbin/chkconfig yum-updatesd --list
yum-updatesd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@gws1 ~]# /sbin/chkconfig yum-updatesd
[root@gws1 ~]# echo $?
0
</pre>
As best I can tell it returns 0 if anything in 345 is on and 1 if they are set
to off.
I'm not sure if this will be changeable/fixable in puppet but it would be nice
to either change service so it runs 'chkconfig --levels 0 service' for each
level (so six calls per service, and all the associated tracking.) or even
potentially add a runlevels => property that would then spawn the six calls
only if set to reduce process spam.
Sadly we can't just do 'chkconfig --levels 0123456 service' as it's not smart
enough to handle that.
--
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.