Bug 226804 - chkconfig behavior returns an error that looks like a syntax problem when it should not
chkconfig behavior returns an error that looks like a syntax problem when it ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: chkconfig (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Ben Levenson
: Reopened
: 439361 (view as bug list)
Depends On:
Blocks: 234547
  Show dependency treegraph
 
Reported: 2007-02-01 13:00 EST by Red Hat Production Operations
Modified: 2014-03-16 23:05 EDT (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2008-0456
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 11:27:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
potential patch (550 bytes, patch)
2007-02-01 13:21 EST, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Red Hat Production Operations 2007-02-01 13:00:53 EST
Description of problem:

On any of our OS releases prior to RHEL5 (and FC5/6 as far as I can tell), chkconfig would return no 
error output when it was executed on a host to query for a service if it is not installed.  Example:

[csmith@monitor ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
[monitor.mgmt.stage.redhat.com] [12:54:03 PM]
[csmith@monitor ~]$ rpm -qa | grep ypserv
[monitor.mgmt.stage.redhat.com] [12:54:10 PM]
[csmith@monitor ~]$ /sbin/chkconfig ypserv
[monitor.mgmt.stage.redhat.com] [12:54:18 PM]
[csmith@monitor ~]$

On RHEL5 hosts, it now returns what _appears_ as a syntax error on the host with the same situation:

[root@rhnserver3 ~]# /sbin/chkconfig ypserv
chkconfig version 1.3.30.1 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage:   chkconfig --list [name]
         chkconfig --add <name>
         chkconfig --del <name>
         chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>
[rhnserver3.proxy.stage.redhat.com] [12:55:57 PM]
[root@rhnserver3 ~]# yum -y install ypserv &>/dev/null
[rhnserver3.proxy.stage.redhat.com] [12:56:28 PM]
[root@rhnserver3 ~]# /sbin/chkconfig ypserv
[rhnserver3.proxy.stage.redhat.com] [12:56:34 PM]
[root@rhnserver3 ~]# rpm -e ypserv
[rhnserver3.proxy.stage.redhat.com] [12:56:36 PM]
[root@rhnserver3 ~]# 

This causes errors to be displayed in shell commands or automated scripts that rely on it.  STDERR can 
certainly be redirected, but this doesn't seem to be the correct solution or the correct behavior for the 
command based on past history.

Version-Release number of selected component (if applicable):

chkconfig-1.3.13.4-1 (RHEL4u4)
chkconfig-1.3.30.1-1 (RHEL5b2+)

How reproducible:

On any RHEL5 box, at any time.

Steps to Reproduce:

See information pasted above.
  
Actual results:

See information pasted above.

Expected results:

I would expect the command to return with no error output.

Additional info:
Comment 1 Bill Nottingham 2007-02-01 13:20:05 EST
So, this is the result of two fixes:

- enable 'chkconfig <foo>' to work for xinetd services (bug 63123)
- reporting errors when passed invalid commandline arguments (bug 147393)

These went into chkconfig-1.3.15, which was in FC4+.

We could change this, although it would essentially revert bug 147393.
Comment 2 Bill Nottingham 2007-02-01 13:21:00 EST
Created attachment 147126 [details]
potential patch
Comment 3 Red Hat Production Operations 2007-02-01 13:27:43 EST
Bill--

That's cool.  But how is what I've shown in my example an incorrect command line argument?  

CMS
Comment 4 Bill Nottingham 2007-02-01 13:35:26 EST
It's really not. I suppose someone might want more feedback about the service
not existing, as opposed to just not being enabled. But that would be a bigger
change.

Putting on the 5.1 radar.
Comment 5 RHEL Product and Program Management 2007-06-05 16:38:54 EDT
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Since this
bugzilla is in a component that is not approved for the current
release, it has been closed with resolution deferred.  You may
reopen this bugzilla for consideration in the next release.
Comment 9 Bill Nottingham 2007-11-13 12:15:07 EST
Fixed in 1.3.30.1-2.
Comment 13 Vladimir Giszpenc 2008-03-26 10:15:47 EDT
The "fix" is to swallow the fact that something is wrong.  If a user does 

  chkconfig --list foo

You get:
error reading information on service foo: No such file or directory

Why not give the same message for

  chkconfig foo
Comment 14 Bill Nottingham 2008-03-26 11:17:29 EDT
Because changing it breaks past historical usage.
Comment 15 Bill Nottingham 2008-03-28 11:56:35 EDT
*** Bug 439361 has been marked as a duplicate of this bug. ***
Comment 16 errata-xmlrpc 2008-05-21 11:27:05 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0456.html

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