]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
dhcp: Fix some configuration paths. dhcp
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 9 Sep 2012 16:09:55 +0000 (16:09 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 9 Sep 2012 16:12:26 +0000 (16:12 +0000)
Enable automatic generation of configuration files
for the server daemons.

dhcp/dhcp.nm
dhcp/systemd/dhcpd.service
dhcp/systemd/dhcpd6.service

index c2db7d2563ed868cc72efca9ddf9e087306f1e96..d0ffab831e7d0d823969c2beb3144fc21ac3c60e 100644 (file)
@@ -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*
index 51f1a56c2934bf902eede6058f8f2678a6114793..09ba1a198a4a2f95871e3199e07f5a4bd0d6767f 100644 (file)
@@ -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]
index 093126480c9f2301cde714177379616a0fd992eb..6f5475ffca67c19aa642209ad2d9599e55a88e15 100644 (file)
@@ -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]