Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#792894: systemd units for dhcp server (addressing ipv4 and ipv6)

44 views
Skip to first unread message

Marc Haber

unread,
Jul 19, 2015, 5:00:03 PM7/19/15
to
Package: isc-dhcp-server
Version: 4.3.2-1
Severity: wishlist

Hi,

in order to address #592539, I have written a bunch of systemd units
which take care of starting isc-dhcp-server without the init script,
catering for IPv6 setups.

These units activate themselves for IPv4 if dhcpd.conf or dhcpd4.conf
is found, and for IPv6 if dhcp6d.conf is found. Due to shortcomings in
the semantics of a systemd unit, /etc/default/isc-dhcp-server is not
honored any more at all.

These are my first systemd units, so there might be beginner's errors.

They are meant to go in /lib/systemd/system, but were only tested on
my system in /etc/systemd/system.

isc-dhcp-server.target:
[Unit]
Description=ISC DHCP Server (all protocols)
After=network.target

[Install]
WantedBy=multi-user.target


isc-dhcp-server-v4.service:
[Unit]
Description=ISC DHCP Server for IPv4 (dhcpd4.conf)
After=network.target
ConditionPathExists=/etc/dhcp/dhcpd4.conf
PartOf=isc-dhcp-server.target

[Service]
Environment="DHCPD4_CONF=/etc/dhcp/dhcpd4.conf"
ExecStartPre=/usr/sbin/dhcpd -f -t -4 -q $OPTIONS -cf "$DHCPD4_CONF"
ExecStart=/usr/sbin/dhcpd -f -4 -q $OPTIONS -cf "$DHCPD4_CONF"

[Install]
WantedBy=isc-dhcp-server.target


isc-dhcp-server-v4-old.service:
[Unit]
Description=ISC DHCP Server for IPv4 (dhcpd.conf)
After=network.target
ConditionPathExists=/etc/dhcp/dhcpd.conf
PartOf=isc-dhcp-server.target

[Service]
Environment="DHCPD_CONF=/etc/dhcp/dhcpd.conf"
ExecStartPre=/usr/sbin/dhcpd -f -t -4 -q $OPTIONS -cf "$DHCPD_CONF"
ExecStart=/usr/sbin/dhcpd -f -4 -q $OPTIONS -cf "$DHCPD_CONF"

[Install]
WantedBy=isc-dhcp-server.target



isc-dhcp-server-v6.service:
[Unit]
Description=ISC DHCP Server for IPv6
After=network.target
ConditionPathExists=/etc/dhcp/dhcpd6.conf
PartOf=isc-dhcp-server.target

[Service]
Environment="DHCPD6_CONF=/etc/dhcp/dhcpd6.conf"
ExecStartPre=/usr/sbin/dhcpd -f -t -6 -q $OPTIONS -cf "$DHCPD6_CONF"
ExecStart=/usr/sbin/dhcpd -f -6 -q $OPTIONS -cf "$DHCPD6_CONF"

[Install]
WantedBy=isc-dhcp-server.target



I place those unit files under the ISC license and will relicense
freely if asked to by the package maintainers to ease packaging for
Debian.

Greetings
Marc


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Nicolas Quiniou-Briand

unread,
Mar 14, 2018, 12:00:03 PM3/14/18
to
Hello,

As mentioned in [0], isc-dhcp-server has failed state in Stretch (via
systemd). /etc/init.d/isc-dhcp-server seems to be "buggy" on IPv6 part.

With this settings in /etc/default/isc-dhcp-server :
--
INTERFACES="MY_INTERFACE_NAME"
INTERFACESv4="MY_INTERFACE_NAME"
--

isc-dhcp-server service can be manage with systemd.

--
Nicolas

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792894#56

Luca Boccassi

unread,
Oct 2, 2022, 3:20:04 PM10/2/22
to
On Sun, 10 May 2020 15:07:06 +0200 Dirk Heinrichs
<dirk.he...@altum.de> wrote:
> Hi,
>
> I wonder why these two bugs are considered blockers for this one?
From
> the 3 scenarios below
>
>   * DHCPv4 only
>   * DHCPv6 only
>   * DHCPv4 and DHCPv6
>
> only the last one would need to have both started, so only this
_might_
> have a use for compound target units. But even if they are not
> available, one can still enable/start each service separately via its
> own service file. This means that 826011 and 826012 are, at most,
nice
> to have, but in no way are they blocking systemd service files for
> isc-dhcp-server, right?
>
> In addition, the current init script based mechanism for running both
is
> also buggy: When one service got killed, its PID file is still
around,
> which results in the init script refusing to start ANY of them unless
> that PID file is removed.
>
> So, please, replace the current init script with proper, independent
> systemd service files for both dhcpdv4 and dhcpdv6 for bullseye. A
> compound target unit can still be added later.
>
> Bye...
>
>     Dirk

Ping - any update on this? It would be good to get this sorted as
mentioned above. isc-dhcp is one of the few popular packages left
without native units.

--
Kind regards,
Luca Boccassi
signature.asc
0 new messages