Description of problem: 'man dhcpd' explicitely says: ... -cf config-file Path to alternate configuration file. ... Despite of the above /usr/lib/systemd/system/dhcpd.service has in it: ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS So if one has indeed a configuration file specified in /etc/sysconfig/dhcpd (with a help of DHCPDARGS) then a running process looks like that: /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid -cf <alternate_config> <whatever_else> At this moment that happens to work as intended but it relies on particulars of an argument parsing by dhcpd and there are no guarantees that this will be like that in the future. Before dhcpd.service a startup script for dhcpd was careful enough to check what is in $DHCPDARGS and emit an options string accordingly. One possible solution would be to drop "-cf /etc/dhcp/dhcpd.conf" from 'ExecStart= ...'. This is a default and it will be used anyway if not explicitely overriden with '-cf ...'. Another to move as many options as possible to 'DHCPDARGS=...' in /etc/sysconfig/dhcpd so they can be edited there as needed. Yet another one to have 'option_helper' to check $DHCPDARGS, produce needed option string and have something like 'ExecStart=/usr/sbin/dhcpd $(option_helper)' in a service file. Version-Release number of selected component (if applicable): dhcp-4.2.4-9.P1.fc17 (and others). Additional info: All the above applies to /usr/lib/systemd/system/dhcpd6.service as well
Hi Michal, you are right and your suggested solutions make sense but I have even one another, see later. (In reply to comment #0) > One possible solution would be to drop "-cf /etc/dhcp/dhcpd.conf" from > 'ExecStart= ...'. This is a default and it will be used anyway if not > explicitely overriden with '-cf ...'. This is how it used to be until 4.2.4-0.5.rc1. I added the -cf to dhcpd.service file as a work-around to bug #819325. The reason was that 'service dhcpd status' now shows what configuration file the daemon actually reads. > Another to move as many options as > possible to 'DHCPDARGS=...' in /etc/sysconfig/dhcpd so they can be edited > there as needed. The /etc/sysconfig/dhcpd and $DHCPDARGS are a relic of SysV Initscripts. And I actually think it's time to remove them at all. The preferred way to customize a service file is to copy it to /etc/systemd/system and modify there. See https://fedoraproject.org/wiki/Packaging:Systemd#EnvironmentFiles_and_support_for_.2Fetc.2Fsysconfig_files > Yet another one to have 'option_helper' to check > $DHCPDARGS, produce needed option string and have something like > 'ExecStart=/usr/sbin/dhcpd $(option_helper)' in a service file. The same as above comment.
(In reply to comment #1) > See > https://fedoraproject.org/wiki/Packaging: > Systemd#EnvironmentFiles_and_support_for_.2Fetc.2Fsysconfig_files That says "Either approach is valid in Fedora". :-) If you mean "roll your own" second to the last paragraph in that section then this does not strike me as a good design. Not that I am at all surprised. There is also a small matter of upgrading an existing, working, installation and not springing surprises with that.
(In reply to comment #1) > The preferred way to > customize a service file is to copy it to /etc/systemd/system and modify > there. One other thing why this is VERY BAD. If you will follow "the preferred way" then you are condemned in perpetuity for checking if a file you copied did not change for whatever reasons and some may be important. I already have seen systems where something like that was done one time or another for debugging purposes and forgotten. This is shifting costs of misdesign on users/administrators.
Hi Michal, Because the /etc/sysconfig/dhcpd and $DHCPDARGS are a relic of SysV Initscripts and it is preferred to customize the service file and because we consider DHCP service files to be stable, we decided to remove Environment Files and DHCPDARGS. Changes will be applied to the next release.
dhcp-4.2.4-15.P2.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/dhcp-4.2.4-15.P2.fc18
dhcp-4.2.4-15.P2.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
(In reply to comment #4) > Because the /etc/sysconfig/dhcpd and $DHCPDARGS are a relic of SysV > Initscripts and it is preferred to customize the service file Not really. After I read more of systemd documentation and looked at more of "real life" systemd units examples I am quite convinced that dhcpd.service file should look somewhat like this: [Unit] Description=DHCPv4 Server Daemon Documentation=man:dhcpd(8) man:dhcpd.conf(5) After=network.target After=time-sync.target [Service] EnvironmentFile=/etc/sysconfig/dhcpd ExecStart=/usr/sbin/dhcpd -f -user dhcpd -group dhcpd --no-pid $DHCPDARGS [Install] WantedBy=multi-user.target with a default /etc/sysconfig/dhcpd containing DHCPDARGS="-cf /etc/dhcp/dhcpd.conf" Of course a split between "fixed" and "configurable" options does not have to be like here but it seems to be reasonable. On a Fedora 18 installation I checked 41 systemd units is using an explicitely documented 'EnvironmentFile' so it hardly can be called a relic. I strongly suggest that you reconsider.
That's quite unlikely, sorry Michal. See also bug #909733.