[Unit]
Description=IPv4 DHCP server (single interface)
After=network.target network-online.target
Wants=network-online.target
Wants=dhcpcd.target
After=dhcpcd.target

[Service]
Type=forking
ExecStart=/usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf -pf /run/dhcpd4/dhcpd.pid %I
RuntimeDirectory=dhcpd4
PIDFile=/run/dhcpd4/dhcpd.pid
User=dhcp
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW
ProtectSystem=full
ProtectHome=on
KillSignal=SIGINT
# We pull in network-online.target for a configured network connection.
# However this is not guaranteed to be the network connection our
# networks are configured for. So try to restart on failure with a delay
# of two seconds.
RestartSec=2s
Restart=on-failure

[Install]
WantedBy=multi-user.target
