commit | 73720ddfe0e4a665b53c4e6ef6fc4365fdcc5ce0 | [log] [tgz] |
---|---|---|
author | Tomáš Pecka <tomas.pecka@cesnet.cz> | Tue Feb 16 20:06:02 2021 +0100 |
committer | Tomáš Pecka <tomas.pecka@cesnet.cz> | Wed Feb 17 13:57:11 2021 +0100 |
tree | cde0b80a033331db1bd42552f05ea02376cefb2f | |
parent | a42931c9e3e24cf2acd72c874388bd30448e2f24 [diff] [blame] |
Restore network configuration on startup Recent change to velia introduced persisting network configuration. It just copies the .network file to /cfg partition. On boot it must be restored into /run/systemd/network directory so systemd-networkd can find the configuration. If no configuration is found in /cfg, use the default configuration for eth1 device, i.e., bridge. Depends-on: https://cesnet-gerrit-czechlight/c/CzechLight/velia/+/3814 Depends-on: https://cesnet-gerrit-public/c/CzechLight/velia/+/3814 Depends-on: https://gerrit.cesnet.cz/c/CzechLight/velia/+/3814 Change-Id: I8d852b329b3189bc8c6bef5e34c0d4d86ea963b1
diff --git a/package/czechlight-cfg-fs/cfg-restore-systemd-networkd.service b/package/czechlight-cfg-fs/cfg-restore-systemd-networkd.service new file mode 100644 index 0000000..c8ca250 --- /dev/null +++ b/package/czechlight-cfg-fs/cfg-restore-systemd-networkd.service
@@ -0,0 +1,14 @@ +[Unit] +Description=Restore systemd-networkd network settings from /cfg +After=cfg.mount +Requires=cfg.mount +Before=network-pre.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStartPre=/usr/bin/mkdir -p /run/systemd/network +ExecStart=/bin/sh -c "[[ -f /cfg/network/eth1.network ]] && cp /cfg/network/eth1.network /run/systemd/network/ || true" + +[Install] +WantedBy=network-pre.target