Bug 887205 - chkconfig resetpriorities updates only start scripts
Summary: chkconfig resetpriorities updates only start scripts
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: chkconfig
Version: 6.3
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
Depends On:
Blocks: 1311466 1347537
TreeView+ depends on / blocked
Reported: 2012-12-14 10:21 UTC by Tomas Dolezal
Modified: 2016-06-17 07:58 UTC (History)
1 user (show)

Fixed In Version: chkconfig-
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1311466 1347537 (view as bug list)
Last Closed: 2016-05-10 21:14:42 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0829 0 normal SHIPPED_LIVE chkconfig bug fix update 2016-05-10 22:41:05 UTC

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):

How reproducible:

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.


Note You need to log in before you can comment on or make changes to this bug.