View Issue Details

IDProjectCategoryView StatusLast Update
0016785CentOS-7dhcppublic2019-11-29 14:32
Status newResolutionopen 
Product Version7.7-1908 
Target VersionFixed in Version 
Summary0016785: Stupid thing, but if you have a 0-byte /etc/dhcp/config-file-to-be-included-indhcpd.conf that file remains open
DescriptionIf you have several (sub) configuration files under /etc/dhcp/[blah].conf that are included in your master /etc/dhcp/dhcpd.conf file, it is odd that if you have not populated one of those files with data, that the application keeps that regular file open. Other config files with data are open, read, and closed.

Steps To ReproduceTo reproduce

1. Create a /etc/dhcpd/test-file.conf as
          # touch /etc/dhcpd/test-file.conf

2. Edit /etc/dhcp/dhcpd.conf to include this config file

        # echo "include \"/etc/dhcp/test-file.conf\"" >> /etc/dhcp/dhcpd.conf

3. Restart dhpcd

          # systemctl restart dhcpd
          # systemctl status dhcpd

4. Check for open files

            # lsof | grep dhcp | grep etc | grep REG

and you will see that 0-byte file held open.
Additional InformationWhy would you have a 0-byte file? New buildout and you design for several subnets and are creating reservation files for each subnet. Work around is to either

a) ignore the fact that config files are left open by the dhcp daemon
b) delete that 0-byte file
c) Add a comment to that 0-byte file and restart DHCP.
    Oddly, if you add a comment to the file then DHCPD will process and close that file!

              # echo "# Comment to file as a place-holder" >> /etc/dhcpd/test-file.conf
              # systemctl restart dhcpd
              # systemctl status dhcpd
              # lsof | grep dhcp | grep etc | grep REG

   and now this file is no longer held open!

I know this is a silly bug to report. I am just working on the cleanup for an initial buildout that someone else did and this was an oddity that I noticed. The daemon should not hold 0-byte files open. This is trivial and the work around is to know what you are doing. So maybe this should not even be a bug report.
TagsNo tags attached.


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-11-29 14:31 feralpenguin New Issue