Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #206302

Re: systemd: how to start a service (kea DHCP4) after all network interfaces are up?

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: systemd: how to start a service (kea DHCP4) after all network interfaces are up?
Date 2019-03-18 13:50 +0100
Message-ID <xCZSi-1wW-1@gated-at.bofh.it> (permalink)
References <xCfZ7-3w0-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Mar 16, 2019 at 12:31:50PM +0100, Markus Schönhaber wrote:
> It seems that the DHCP server is started while the interface it is
> configured to listen on is not yet up and therefore refuses to work.
> How can I make sure that the kea-dhcp4-server.service is started no
> sooner than after all network interfaces are up?

1) Make sure the interface is marked "auto" and NOT "allow-hotplug"
   in /etc/network/interfaces.

   Interfaces that are marked "auto" are required to be up before systemd
   will consider network-online.target to be satisfied.  Interfaces that
   are marked "allow-hotplug" are NOT required to be up.

   Note that the Debian installer marks all interfaces except loopback
   as "allow-hotplug" because it assumes you're using a laptop with a
   Wifi or removable USB network interface, even if the interface is
   actually PCI and internal, or even soldered to the motherboard, even
   if the machine you're installing on is a desktop PC or a rack-mounted
   server.

2) Make sure your service has

[Unit]
Wants= network-online.target
After= network-online.target

   either in the native unit file, or in a local drop-in directory.

   Services with these options will wait for all network interfaces that
   are marked "auto" to be brought up, before these services can be
   started.

Don't forget the daemon-reload.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2019-03-16 12:50 +0100
  Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? john doe <johndoe65534@mail.com> - 2019-03-16 14:40 +0100
    Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2019-03-16 19:40 +0100
      Re: systemd: how to start a service (kea DHCP4) after all network interfaces are up? Sven Joachim <svenjoac@gmx.de> - 2019-03-16 21:30 +0100
        Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2019-03-17 17:20 +0100
  Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Greg Wooledge <wooledg@eeg.ccf.org> - 2019-03-18 13:50 +0100
    Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2019-03-18 14:30 +0100
      Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Curt <curty@free.fr> - 2019-03-18 18:50 +0100
  Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Henning Follmann <hfollmann@itcfollmann.com> - 2019-03-18 20:30 +0100
    Re: systemd: how to start a service (kea DHCP4) after all network  interfaces are up? Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2019-03-18 21:00 +0100

csiph-web