Last active
March 4, 2022 14:35
-
-
Save cbrake/5092651 to your computer and use it in GitHub Desktop.
systemd network hotplugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DESCRIPTION = "Network Hotplug" | |
LICENSE = "CLOSED" | |
PR = "r1" | |
SRC_URI = " \ | |
file://[email protected] \ | |
file://network.rules \ | |
" | |
FILES_${PN} = "${sysconfdir}/udev/rules.d/* ${base_libdir}/systemd/system/*" | |
RDEPENDS_${PN} = "udev" | |
do_install() { | |
install -d ${D}${base_libdir}/systemd/system/basic.target.wants | |
install -m 0644 ${WORKDIR}/*.service ${D}${base_libdir}/systemd/system | |
install -d ${D}${sysconfdir}/udev/rules.d | |
install -m 0644 ${WORKDIR}/network.rules ${D}${sysconfdir}/udev/rules.d/network.rules | |
} | |
================================================ | |
more files/[email protected] | |
# currently, the BindTo is not working | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/sbin/ifup -f %i | |
StandardOutput=syslog+console | |
BindsTo=%i.device | |
================================================ | |
more files/network.rules | |
SUBSYSTEM=="net", KERNEL!="lo", ENV{SYSTEMD_WANTS}="network@$name.service" ENV{SYSTEMD_ALIAS}="/$name" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like systemd.unit uses "BindsTo=" not "BindTo="