Bug #10980

Service provider in RedHat will not create K?? stop scripts

Added by Andoni Auzmendi 6 months ago. Updated 5 months ago.

Status:Accepted Start date:11/21/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:service
Target version:2.7.x
Affected Puppet version:2.7.6 Branch:
Keywords:service redhat linux enable
Votes: 3

Description

When a service is set to be enabled the provider/service/redhat.rb provider will run “/sbin/chkconfig $name on” which will only create the links for starting the service but will not for stopping it. The correct command is “/sbin/chkconfig —add $name”.

This is important for those services that require stopping cleanly before other services.

History

Updated by Michael Stahnke 6 months ago

  • Status changed from Unreviewed to Accepted
  • Target version set to 2.7.x

Confirmed.

[root@centos5-64 init.d]# chkconfig --del httpd
[root@centos5-64 init.d]# find /etc/rc.d/ | grep httpd
/etc/rc.d/init.d/httpd
[root@centos5-64 init.d]# cat test.pp 
service { "httpd":
enable => true
}
[root@centos5-64 init.d]# puppet apply --verbose test.pp 
/usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:48: warning: parenthesize argument(s) for future version
info: Applying configuration version '1321582482'
notice: /Stage[main]//Service[httpd]/enable: enable changed 'false' to 'true'
notice: Finished catalog run in 0.14 seconds
[root@centos5-64 init.d]# find /etc/rc.d/ | grep httpd
/etc/rc.d/rc5.d/S85httpd
/etc/rc.d/rc2.d/S85httpd
/etc/rc.d/rc3.d/S85httpd
/etc/rc.d/init.d/httpd
/etc/rc.d/rc4.d/S85httpd
[root@centos5-64 init.d]# 

We should be running chkconfig —add $service then chkconfig on $service

Updated by Stijn Hoop 5 months ago

Please look into removing /etc/rc.d/rc?.d/K*service as well when a service is disabled.

Also available in: Atom PDF