From b781eae54d011280936fea367d0be6f6e2bd8c2a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 9 Sep 2012 16:09:55 +0000 Subject: [PATCH] dhcp: Fix some configuration paths. Enable automatic generation of configuration files for the server daemons. --- dhcp/dhcp.nm | 25 +++++++++++++++++-------- dhcp/systemd/dhcpd.service | 1 + dhcp/systemd/dhcpd6.service | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dhcp/dhcp.nm b/dhcp/dhcp.nm index c2db7d256..d0ffab831 100644 --- a/dhcp/dhcp.nm +++ b/dhcp/dhcp.nm @@ -5,7 +5,7 @@ name = dhcp version = 4.2.2 -release = 4 +release = 5 groups = Networking/Daemons url = http://isc.org/products/DHCP/ @@ -75,9 +75,9 @@ build -Wl,--as-needed configure_options += \ - --sysconfdir=/etc \ + --sysconfdir=%{sysconfdir}/dhcp \ --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \ - --with-srv6-lease-file=/var/lib/dhcpd/dhcp6.leases \ + --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \ --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \ --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \ --with-srv-pid-file=/run/dhcpd.pid \ @@ -103,7 +103,7 @@ build end install_cmds - rm -vf %{BUILDROOT}/etc/dhclient.conf + rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf # Move the client to /sbin, create dirs # and remove the default config. @@ -127,19 +127,23 @@ end packages package %{name} - requires - dhcp-common + dhcp-common = %{thisver} + dhcp-libs = %{thisver} + /usr/lib/network/helpers/dhcpd-config-helper end prerequires += shadow-utils + configfiles + %{sysconfdir}/dhcp + end + script prein getent group dhcpd >/dev/null || groupadd -r dhcpd getent passwd dhcpd >/dev/null || \ useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \ -c "User for the DHCP server" dhcpd - exit 0 end # Just search for new unit files that were just installed. @@ -176,7 +180,8 @@ packages description = %{summary} requires - dhcp-common + dhcp-common = %{thisver} + dhcp-libs = %{thisver} end files @@ -205,6 +210,10 @@ packages summary = Common files used by the dhcp client and server. description = %{summary} + requires + dhcp-libs = %{thisver} + end + files /usr/bin/ /usr/share/man/man1/omshell.1* diff --git a/dhcp/systemd/dhcpd.service b/dhcp/systemd/dhcpd.service index 51f1a56c2..09ba1a198 100644 --- a/dhcp/systemd/dhcpd.service +++ b/dhcp/systemd/dhcpd.service @@ -3,6 +3,7 @@ Description=DHCPv4 Server Daemon After=syslog.target network.target [Service] +ExecStartPre=/usr/lib/network/helpers/dhcpd-config-helper create ipv4 ExecStart=/usr/sbin/dhcpd -d -user dhcpd -group dhcpd --no-pid [Install] diff --git a/dhcp/systemd/dhcpd6.service b/dhcp/systemd/dhcpd6.service index 093126480..6f5475ffc 100644 --- a/dhcp/systemd/dhcpd6.service +++ b/dhcp/systemd/dhcpd6.service @@ -3,6 +3,7 @@ Description=DHCPv6 Server Daemon After=syslog.target network.target [Service] +ExecStartPre=/usr/lib/network/helpers/dhcpd-config-helper create ipv6 ExecStart=/usr/sbin/dhcpd -d -6 -user dhcpd -group dhcpd --no-pid [Install] -- 2.47.2