Bug 491868 - service dhcpd reload silently fails
service dhcpd reload silently fails
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: dhcp (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: David Cantrell
Alexander Todorov
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-24 09:55 EDT by Carsten Clasohm
Modified: 2009-09-02 06:13 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 06:13:18 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)

  None (edit)
Description Carsten Clasohm 2009-03-24 09:55:08 EDT
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-16 21:14:56 EDT
'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-16 21:16:00 EDT
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 Product and Program Management 2009-04-16 21:28:43 EDT
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-20 22:04:44 EDT
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 17:04:44 EDT
Fixed in dhcp-3.0.5-20.el5 and later.
Comment 8 Alexander Todorov 2009-05-08 06:23:08 EDT
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 06:13:18 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 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.