diff options
author | Markus Mayer <mmayer@broadcom.com> | 2017-10-31 15:36:59 -0700 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-11-02 23:03:36 +0100 |
commit | e04c5d3c34961aebf254b01a2bcb8508979446aa (patch) | |
tree | fe3df8685d8d7e0505bd5a3ef8a8ad85ad00c16c | |
parent | 3a83323eea130689a0700631d6e6b7ebdba3258e (diff) | |
download | buildroot-e04c5d3c34961aebf254b01a2bcb8508979446aa.tar.gz buildroot-e04c5d3c34961aebf254b01a2bcb8508979446aa.zip |
dhcpcd: add systemd start-up service
Add systemd start-up configuration for dhcpcd that is executed after
the network has been brought up.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r-- | package/dhcpcd/dhcpcd.mk | 8 | ||||
-rw-r--r-- | package/dhcpcd/dhcpcd.service | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/package/dhcpcd/dhcpcd.mk b/package/dhcpcd/dhcpcd.mk index cf1da4f147..dc5c69b86b 100644 --- a/package/dhcpcd/dhcpcd.mk +++ b/package/dhcpcd/dhcpcd.mk @@ -41,6 +41,14 @@ define DHCPCD_INSTALL_INIT_SYSV $(TARGET_DIR)/etc/init.d/S41dhcpcd endef +define DHCPCD_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 0644 package/dhcpcd/dhcpcd.service \ + $(TARGET_DIR)/usr/lib/systemd/system/dhcpcd.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -sf ../../../../usr/lib/systemd/system/dhcpcd.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpcd.service +endef + # NOTE: Even though this package has a configure script, it is not generated # using the autotools, so we have to use the generic package infrastructure. diff --git a/package/dhcpcd/dhcpcd.service b/package/dhcpcd/dhcpcd.service new file mode 100644 index 0000000000..0552b5c73a --- /dev/null +++ b/package/dhcpcd/dhcpcd.service @@ -0,0 +1,13 @@ +[Unit] +Description=DHCP client +After=network.target + +[Service] +Type=forking +EnvironmentFile=-/etc/default/dhcpcd +PIDFile=/var/run/dhcpcd.pid +ExecStart=/sbin/dhcpcd $DAEMON_ARGS +Restart=always + +[Install] +WantedBy=multi-user.target |