From 6995afb6f1b01938e4a3ca0daf375dfe276181d5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 11 Aug 2021 15:58:09 +0200 Subject: Implement blocking network.target and network-online.target Add two services that will delay reaching the according targets, until conditions we consider reasonable are reached. For network.target that is finishing DHCP for the primary interface, for network-online.target we want to see a default gateway or a proxy server configured. Both have a timeout of about 10 seconds for now; this might be increased later on, if necessary. --- .../openslx/scripts/systemd-early_network_triggers | 33 ---------------------- 1 file changed, 33 deletions(-) delete mode 100755 core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers (limited to 'core/rootfs/rootfs-stage32/data/opt/openslx/scripts') diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers deleted file mode 100755 index 64ea853e..00000000 --- a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/ash - -# This script will trigger several network targets if -# applicable at an early point. -# This happens if dhcp/network setup was successful in stage31 - -# Main interface -BRIDGE="br0" - -if [ ! -e "/sys/class/net/${BRIDGE}/operstate" -o "x$(cat "/sys/class/net/${BRIDGE}/operstate")" == "xup" ] && [ -e "/opt/openslx/uniontmp/etc/hostname" -o -e "/etc/resolv.conf" ]; then - echo "Triggering network.target" - touch "/run/network/network-ready" - systemctl start network.target & -fi - -if [ -s "/etc/resolv.conf" ] && grep -q "^nameserver" "/etc/resolv.conf"; then - echo "Triggering network-dns.target" - touch "/run/network/dns-ready" - systemctl start network-dns.target & -fi - -if route -n | grep -q -E '^0\.0\.0\.0.*U.*G'; then - echo "Triggering network-gateway.target" - touch "/run/network/gateway-ready" - systemctl start network-gateway.target & -fi - -# In case we have multiple NICs per subnet, don't send arp -# replies on all NICs -echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter - -exit 0 - -- cgit v1.2.3-55-g7522