diff --git a/12-dhcpd b/12-dhcpd index e72e8cd..2757988 100644 --- a/12-dhcpd +++ b/12-dhcpd @@ -1,31 +1,11 @@ #!/bin/bash export LC_ALL=C -[ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd - # restart dhcpd whenever $1 interface is brought up by NM (rhbz #565921) if [ "$2" = "up" ]; then # exit if the service is not configured to be started in the current runlevel /bin/systemctl is-enabled dhcpd.service || exit 0 - ifaces="" # interfaces defined in DHCPDARGS - net=$(ls /sys/class/net) # all interfaces on system - - if [ -n "${DHCPDARGS}" ]; then - for iface in ${net}; do - for arg in ${DHCPDARGS}; do - [ $arg == $iface ] && ifaces="$ifaces $iface" - done - done - fi - - # exit if dhcpd is not defined to listen on $1 - # i.e. if there are interfaces defined in DHCPDARGS and $1 is not among them - if [ -n "${ifaces}" ] && - [[ "${ifaces}" != *$1* ]]; then - exit 0 - fi - # restart service /bin/systemctl restart dhcpd.service || : fi diff --git a/dhcp.spec b/dhcp.spec index a2ee27e..b167ca1 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -18,7 +18,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.2.4 -Release: 13.%{patchver}%{?dist} +Release: 14.%{patchver}%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -418,27 +418,6 @@ touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd.leases touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd6.leases %{__mkdir} -p %{buildroot}%{_localstatedir}/lib/dhclient/ -# Create default sysconfig files for dhcpd and dhcrelay -%{__mkdir} -p %{buildroot}%{_sysconfdir}/sysconfig - -%{__cat} << EOF > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay -# Command line options here -#Example: DHCRELAYARGS="-4 -i eth0 192.168.0.1" -#Example: DHCRELAYARGS="-6 -l eth1 -u eth0" -DHCRELAYARGS="" -# Note: We don't use INTERFACES and DHCPSERVERS anymore (they were DHCPv4 only) -EOF - -%{__cat} < %{buildroot}%{_sysconfdir}/sysconfig/dhcpd -# Command line options here -DHCPDARGS="" -EOF - -%{__cat} < %{buildroot}%{_sysconfdir}/sysconfig/dhcpd6 -# Command line options here -DHCPDARGS="" -EOF - # Copy sample conf files into position (called by doc macro) %{__cp} -p client/dhclient.conf dhclient.conf.sample %{__cp} -p server/dhcpd.conf dhcpd.conf.sample @@ -523,9 +502,6 @@ fi %attr(0755,dhcpd,dhcpd) %dir %{_localstatedir}/lib/dhcpd %attr(0644,dhcpd,dhcpd) %verify(mode) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd.leases %attr(0644,dhcpd,dhcpd) %verify(mode) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd6.leases -%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd -%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd6 -%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay %config(noreplace) %{dhcpconfdir}/dhcpd.conf %config(noreplace) %{dhcpconfdir}/dhcpd6.conf %config(noreplace) %{_sysconfdir}/openldap/schema/dhcp.schema @@ -583,6 +559,10 @@ fi %changelog +* Fri Aug 24 2012 Tomas Hozza - 12:4.2.4-14.P1 +- SystemD unit files don't use Environment files any more (#850558) +- NetworkManager dispatcher script doesn't use DHCPDARGS any more + * Wed Aug 22 2012 Tomas Hozza - 12:4.2.4-13.P1 - fixed SPEC file so it comply with new systemd-rpm macros guidelines (#850089) diff --git a/dhcpd.service b/dhcpd.service index a4251d4..ad7ab4f 100644 --- a/dhcpd.service +++ b/dhcpd.service @@ -4,8 +4,7 @@ Documentation=man:dhcpd(8) man:dhcpd.conf(5) After=network.target [Service] -EnvironmentFile=/etc/sysconfig/dhcpd -ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS +ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid [Install] WantedBy=multi-user.target diff --git a/dhcpd6.service b/dhcpd6.service index 4f48dd0..72e7f89 100644 --- a/dhcpd6.service +++ b/dhcpd6.service @@ -4,8 +4,7 @@ Documentation=man:dhcpd(8) man:dhcpd.conf(5) After=network.target [Service] -EnvironmentFile=/etc/sysconfig/dhcpd6 -ExecStart=/usr/sbin/dhcpd -f -6 -cf /etc/dhcp/dhcpd6.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS +ExecStart=/usr/sbin/dhcpd -f -6 -cf /etc/dhcp/dhcpd6.conf -user dhcpd -group dhcpd --no-pid [Install] WantedBy=multi-user.target diff --git a/dhcrelay.service b/dhcrelay.service index 9302900..178d5b4 100644 --- a/dhcrelay.service +++ b/dhcrelay.service @@ -4,8 +4,7 @@ Documentation=man:dhcrelay(8) After=network.target [Service] -EnvironmentFile=/etc/sysconfig/dhcrelay -ExecStart=/usr/sbin/dhcrelay -d --no-pid $DHCRELAYARGS +ExecStart=/usr/sbin/dhcrelay -d --no-pid [Install] WantedBy=multi-user.target