Bug 491868 - service dhcpd reload silently fails
Summary: service dhcpd reload silently fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: dhcp
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: David Cantrell
QA Contact: Alexander Todorov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-24 13:55 UTC by Carsten Clasohm
Modified: 2009-09-02 10:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 10:13:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1331 0 normal SHIPPED_LIVE dhcp bug fix update 2009-09-01 10:37:36 UTC

Description Carsten Clasohm 2009-03-24 13:55:08 UTC
Description of problem:

Running "service dhcpd reload" doesn't output an error message, but also doesn't reload the DHCP configuration file.


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

dhcp-3.0.5-18.el5

How reproducible:

always

Steps to Reproduce:
1. make changes in /etc/dhcpd.conf
2. run "service dhcpd reload"
  
Actual results:

The changes in /etc/dhcpd.conf are not reloaded, and no error message is printed.

Expected results:

Either /etc/init.d/dhcpd should restart the DHCP daemon to activate the changes, or it should print an error message, telling the user that "reload" is not implemented.

Additional info:

The script sets the exit code to 3 when it encounters the "reload" parameter, but that doesn't help much when you call it manually.

Comment 1 David Cantrell 2009-04-17 01:14:56 UTC
'reload' is not supported by dhcpd.  You have to stop the service and start it again, or use 'restart'.

Status code 3 means the feature you tried is unimplemented:
http://intranet.corp.redhat.com/ic/intranet/InitscriptsSpec.html

However, what I should be doing is just catching 'reload' and 'try-restart' in the * block so the user gets the usage information and 3 is returned by the script.

Comment 2 David Cantrell 2009-04-17 01:16:00 UTC
Super easy fix:


Index: dhcpd.init
===================================================================
RCS file: /cvs/dist/rpms/dhcp/RHEL-5/dhcpd.init,v
retrieving revision 1.17
diff -u -p -r1.17 dhcpd.init
--- dhcpd.init	16 Jul 2008 00:03:39 -0000	1.17
+++ dhcpd.init	17 Apr 2009 01:15:24 -0000
@@ -119,9 +119,6 @@ case "$1" in
         stop ; start
         RETVAL=$?
         ;;
-    try-restart|reload)
-        RETVAL=3
-        ;;
     condrestart)
         if [ -f $lockfile ]; then
             stop ; start

Comment 3 RHEL Program Management 2009-04-17 01:28:43 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 David Cantrell 2009-04-21 02:04:44 UTC
QA,

Can I get a qa ack or nak on this?  It's a really simple change to the init scripts for dhcpd and dhcrelay.  If you pass 'reload' or 'try-restart' to the init script for either service, it should display the usage information and the exit code should be 3.  That's what this fix will bring in (right now it only sets the return code, you don't get a usage screen).

Comment 6 David Cantrell 2009-04-28 21:04:44 UTC
Fixed in dhcp-3.0.5-20.el5 and later.

Comment 8 Alexander Todorov 2009-05-08 10:23:08 UTC
Verified with dhcp-3.0.5-21.el5

[root@gs-bl460cg1-01 ~]# service dhcpd reload; echo $?
Usage: /etc/init.d/dhcpd {start|stop|restart|condrestart|configtest|status}
3

[root@gs-bl460cg1-01 ~]# service dhcpd try-restart; echo $?
Usage: /etc/init.d/dhcpd {start|stop|restart|condrestart|configtest|status}
3

[root@gs-bl460cg1-01 ~]# service dhcrelay reload; echo $?
Usage: /etc/init.d/dhcrelay {start|stop|restart|condrestart|configtest|status}
3

[root@gs-bl460cg1-01 ~]# service dhcrelay try-restart; echo $?
Usage: /etc/init.d/dhcrelay {start|stop|restart|condrestart|configtest|status}
3

Comment 10 errata-xmlrpc 2009-09-02 10:13:18 UTC
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 therefore 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-2009-1331.html


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