Puppet: System Administration Automated

Support

Ticket #1219 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

Disabling a service on Red Hat systems should use 'chkconfig service off', not 'chkconfig --del service'

Reported by: init Assigned to: luke
Priority: normal Milestone: 0.24.5
Component: service Version: 0.24.4
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Attached Patches: Code Complexity: Trivial

Description

Currently, if I disable a service with enable => false, Puppet seems to run 'chkconfig --del servicename'. This is incorrect, as it removes the service from chkconfig management. The correct way is to use 'chkconfig servicename off'.

One of the bad effects of the current behavior is that 'chkconfig --del servicename' removes all the /etc/rc*.d/K*servicename links, which are there to make sure that temporarily started services are allowed to gracefully shutdown on a system shutdown. They are preserved when 'chkconfig servicename off' is used.

Obviously this also means that enable => true should result in a 'chkconfig servicename on' instead of the current 'chkconfig --add servicename'.

Change History

05/13/08 11:00:20 changed by jamtur01

  • complexity changed from Unknown to Trivial.
  • stage changed from Unreviewed to Needs more info.

Actually the provider does both: chkconfig --del service and chkconfig service off and the reverse when enabling.

05/13/08 11:08:39 changed by Fujin

Are there any other reasons why we shouldn't use --add/--del? I don't have any redhat boxen lying around to see what chkconfig --del servicename actually does.

I have the code for this (http://github.com/fujin/puppet/commits/fix1219), but I don't understand enough about the redhat service provider as to how it currently works and what would break if we changed this. As such, I'm going to leave the ticket as needs more info.

Anyone care to offer some input?

05/13/08 12:04:02 changed by init

"Actually the provider does both: chkconfig --del service and chkconfig service off and the reverse when enabling."

But why? The only command that needs to run to enable/disable a service is 'chkconfig servicename on/off', so why also run 'chkconfig --add/del servicename'? The latter commands are used when installing and uninstalling a service (such as by a package manager), and are not supposed to be used for simple enabling/disabling of a service.

05/13/08 14:37:26 changed by Fujin

  • owner changed from community to luke.
  • patch changed from None to Code.
  • stage changed from Needs more info to Ready for checkin.
  • milestone set to 0.24.5.

Sent pull request to Luke

05/13/08 21:36:46 changed by luke

I'm hesitant to accept the patch without feedback from David. I'm emailed him to ask about it.

05/15/08 00:55:32 changed by lutter

Yes, this is the right thing to do. chkonfig --add/--del should only be used by the RPM %post scripts to register a service for management with chkconfig.

05/15/08 09:15:43 changed by jamtur01

  • status changed from new to closed.
  • resolution set to fixed.

Pushed in commit [83ef1b0cda1b010eea3f7d001716ea52f7081c24] in branch 0.24.x