Bug 887205

Summary: chkconfig resetpriorities updates only start scripts
Product: Red Hat Enterprise Linux 6 Reporter: Tomas Dolezal <todoleza>
Component: chkconfigAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3CC: psklenar
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: chkconfig-1.3.49.4-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1311466 1347537 (view as bug list) Environment:
Last Closed: 2016-05-10 21:14:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1311466, 1347537    

Description Tomas Dolezal 2012-12-14 10:21:21 UTC
Description of problem:
resetpriorities command of chkconfig does not reset priority of kill scripts, it works only for existing start scripts

Version-Release number of selected component (if applicable):
chkconfig-1.3.49.3-2.el6

How reproducible:
always

Steps to Reproduce:
1. execute chkconfig <initscript> on #to create S-scripts
2. update both priorities in /etc/rc.d/init.d/<initscript>
3. execute chkconfig <initscript> resetpriorities
4. observe ls /etc/rc.d/rc*.d/*<initscript>
(all tested on initscript = ypbind)
  
Actual results:
S-scripts has updated priorities, K-scripts do not

Expected results:
both S and K scripts has updated priorities accordingly to init script

Additional info:
manpage specifies that:
"the reset priorities flag resets the start/stop priorities for the service to whatever is specifed in the init script"

Comment 2 Lukáš Nykrýn 2012-12-14 13:28:03 UTC
Condition in source code does not correspond with "on and off options affect only runlevels 2, 3, 4, and 5, while reset and  resetpriorities  affects all of the runlevels" from man page, so I would suggest this fix:

--- a/chkconfig.c
+++ b/chkconfig.c
@@ -518,7 +518,7 @@ int setService(char * name, int type, int where, int state) {
     int what;
     struct service s;
     
-    if (!where && state != -1) {
+    if (!where && state != -1 && state != -2) {
        /* levels 2, 3, 4, 5 */
        where = (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5);
     } else if (!where) {

Comment 3 RHEL Program Management 2013-10-14 00:09:51 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 4 Lukáš Nykrýn 2015-12-07 14:22:28 UTC
Devel_ack for patch from  comment 2

Comment 8 errata-xmlrpc 2016-05-10 21:14:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0829.html