Before the conversion from initscripts to systemd units, one could restrict dhcp to (a) certain interface(s) by adding them to the command line, via the DHCPDARGS variable in /etc/sysconfig/dhcpd. Now this capability seems to be gone. How is this usage scenario supposed to work with the new systemd unit files?
By editing the service unit file and adding the desired command line options to the ExecStart=. The recommended way is to copy the service file from /usr/lib/systemd/system to /etc/systemd/system and edit it there. [1] [1] http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions
Specifically: # cp /usr/lib/systemd/system/dhcpd.service /etc/systemd/system/ # vim /etc/systemd/system/dhcpd.service # add the interface name to the end of ExecStart= line # systemctl start dhcpd.service
This is what I have done. I consider this somewhat unsatisfactory, for the following reason: - systemctl enable/disable tends to remove the local modification - upgrades silently break
(In reply to comment #3) > - systemctl enable/disable tends to remove the local modification > - upgrades silently break Could you elaborate more on these as they look like a bugs.
(In reply to comment #4) > (In reply to comment #3) > > - systemctl enable/disable tends to remove the local modification Sorry, my bad. I edited the file in the wrong place: /usr/lib/systemd/system/multi-user.target.wants/dhcpd.service which kinda works, but causes no end of confusion (for example when trying to disable/enable the service) > > - upgrades silently break Because there's no posttrans script to convert DHCPDARGS from: /etc/sysconfig/dhcpd to the edit described, dhcpd ends up listening on interfaces it shouldn't...
(In reply to comment #5) > Because there's no posttrans script to convert DHCPDARGS from: > /etc/sysconfig/dhcpd > to the edit described, dhcpd ends up listening on interfaces it shouldn't... Whoops, sorry. I've added [1][2] %triggerun scriptlet that should handle it. Build is here [3] if you want to help testing it. [1] http://pkgs.fedoraproject.org/cgit/dhcp.git/commit/?id=dd392244183abcf5181df301597b0d988b02609c [2] http://pkgs.fedoraproject.org/cgit/dhcp.git/commit/?id=de40db7e7696d30c4f2983095a0c42409b95c2e0 [3] https://koji.fedoraproject.org/koji/buildinfo?buildID=378811 BTW: (In reply to comment #0) > ... one could restrict > dhcp to (a) certain interface(s) by adding them to the command line ... AFAIK this is not necessary, because dhcpd listens only on interfaces, for whose it finds subnet declaration in config file. For example if interface xyz has configured address 192.168.1.1/24, but there's no 'subnet 192.168.1.0 netmask 255.255.255.0 {}' in config file dhcpd won't listen on that interface. It also tells you that when starting: No subnet declaration for xyz (no IPv4 addresses). ** Ignoring requests on xyz.
(In reply to comment #6) > No subnet declaration for xyz (no IPv4 addresses). Small correction: No subnet declaration for xyz (192.168.1.1).
(In reply to comment #6) > Build is here [3] if you want to help testing it. You'd actually need dhcp < 12:4.2.4-14.P1 to test it, but these builds have already been deleted from our build system. But I've been testing it (with local build of dhcp < 12:4.2.4-14.P1) quite a lot today so it'll hopefuly be ok.
dhcp-4.2.5-2.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/FEDORA-2013-0572/dhcp-4.2.5-2.fc18
Package dhcp-4.2.5-3.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dhcp-4.2.5-3.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-0572/dhcp-4.2.5-3.fc18 then log in and leave karma (feedback).
dhcp-4.2.5-3.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
I've just upgraded from F17 to F18 and %triggerun scriptlet didn't run, because I don't have any modifications in /etc/systemd/system/multi-user.target.wants/dhcpd.service. It's probably because of %triggerun -- dhcp < 12:4.2.4-14.P1, while before upgrade I had dhcp-4.2.4-16.P2.fc17.i686.
(In reply to comment #12) > It's probably because of %triggerun -- dhcp < 12:4.2.4-14.P1, while before upgrade I had dhcp-4.2.4-16.P2.fc17.i686. Right. Should be fixed in dhcp-4.2.5-7.fc18
dhcp-4.2.5-7.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/dhcp-4.2.5-7.fc18
Package dhcp-4.2.5-7.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dhcp-4.2.5-7.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-2941/dhcp-4.2.5-7.fc18 then log in and leave karma (feedback).
dhcp-4.2.5-7.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.