Issue #13980 has been updated by R.I. Pienaar.

Description updated


----------------------------------------
Bug #13980: Services not disabling completely on RHEL 5/6
https://projects.puppetlabs.com/issues/13980#change-60687

Author: Ashley Penney
Status: Unreviewed
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.

Reply via email to