RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1416517 - Cannot specify extra options to dhcpd
Summary: Cannot specify extra options to dhcpd
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dhcp
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Zhukov
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-25 16:50 UTC by Orion Poplawski
Modified: 2019-05-22 12:57 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-22 12:57:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 850558 0 unspecified CLOSED dhcpd.service hardwires dhcpd configuration file 2021-02-22 00:41:40 UTC

Internal Links: 850558

Description Orion Poplawski 2017-01-25 16:50:44 UTC
Description of problem:

On RHEL6, you could do:

# cat /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=eth0

to specify extra options to the dhcpd daemon.  This is no longer the case.

This can be done in the dhcpd.service file with:

EnvironmentFile=-/etc/sysconfig/dhcpd
ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS

Version-Release number of selected component (if applicable):
dhcp-4.2.5-47.sl7.x86_64

It's still nice to force it to limit to desired interfaces to avoid these messages:

Jan 24 16:59:04 earth dhcpd: No subnet declaration for ib0 (192.168.2.5).
Jan 24 16:59:04 earth dhcpd: ** Ignoring requests on ib0.  If this is not what
Jan 24 16:59:04 earth dhcpd:   you want, please write a subnet declaration
Jan 24 16:59:04 earth dhcpd:   in your dhcpd.conf file for the network segment
Jan 24 16:59:04 earth dhcpd:   to which interface ib0 is attached. **
Jan 24 16:59:04 earth dhcpd: 
Jan 24 16:59:04 earth dhcpd: 
Jan 24 16:59:04 earth dhcpd: No subnet declaration for eth1 (192.168.1.5).
Jan 24 16:59:04 earth dhcpd: ** Ignoring requests on eth1.  If this is not what
Jan 24 16:59:04 earth dhcpd:   you want, please write a subnet declaration
Jan 24 16:59:04 earth dhcpd:   in your dhcpd.conf file for the network segment
Jan 24 16:59:04 earth dhcpd:   to which interface eth1 is attached. **

without having it listen on those interfaces via a subnet declaration.

Copying the service file to /etc/systemd/system as suggested in the current /etc/sysconfig/dhcpd is problematic as any future possible fixes to the dhcpd.service file are not picked up automatically.

Comment 1 Orion Poplawski 2017-01-25 17:00:20 UTC
FWIW - I ended up doing:

# cat /etc/systemd/system/dhcpd.service.d/interface.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid eth0


As at least that just overwrites the ExecStart option.

Comment 4 Pavel Zhukov 2017-05-03 15:51:14 UTC
(In reply to Orion Poplawski from comment #0)
> Description of problem:
> 
> On RHEL6, you could do:
> 
> # cat /etc/sysconfig/dhcpd
> # Command line options here
> DHCPDARGS=eth0
> 
> to specify extra options to the dhcpd daemon.  This is no longer the case.

Hi Orion,

Thank you for raising the issue.
It was done intentionally and you should be able to see the explanation right in /etc/sysconfig/dhcpd file [1] or in https://bugzilla.redhat.com/show_bug.cgi?id=895475#c6 
  

[1]


# If you are here to restrict what interfaces should dhcpd listen on,
# be aware that dhcpd listens *only* on interfaces for which it finds subnet
# declaration in dhcpd.conf. It means that explicitly enumerating interfaces
# also on command line should not be required in most cases.

# If you still insist on adding some command line options,
# copy dhcpd.service from /lib/systemd/system to /etc/systemd/system and modify
# it there.
# https://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F

# example:
# $ cp /usr/lib/systemd/system/dhcpd.service /etc/systemd/system/
# $ vi /etc/systemd/system/dhcpd.service
# $ ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid <your_interface_name(s)>
# $ systemctl --system daemon-reload
# $ systemctl restart dhcpd.service

Comment 5 Orion Poplawski 2017-05-05 22:29:20 UTC
Please re-read all of my comments carefully, as I point out the issue with the suggested scheme and the unwanted log messages.  Otherwise, feel free to close wontfix.

Comment 6 Scott Shambarger 2017-11-19 00:28:41 UTC
I see that the installed /etc/sysconfig/dhcpd file indicates that it's "NOT used anymore", but as of 4.3.5-4 it is actually used again.

The default sysconfig/dhcpd file should probably be updated.

In addition, it's suggested workaround is rather dated, and should probably suggest using drop-ins (not copying the dhcpd.service file ;)

Comment 8 Pavel Zhukov 2019-05-22 12:57:14 UTC
Hello,
This request was evaluated by Red Hat Engineering for inclusion in a Red Hat Enterprise Linux and was not considered as a priority for the release, so it's being closed now as WONTFIX. Feel free to re-open the bug if there is a business reason to deliver a fix for this issue.


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