From 50d5be08ca006dcd367bdc9cd1ed894641e0bbff Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Thu, 5 Apr 2012 10:43:16 +0100 Subject: network: Write a flag that can be used as a trigger for udev udev might detect network interfaces that in turn check to see if the network subsystem is ready. It did this via checking a file in /var/lock, but this is not a good idea if that file system tree is messy from a previous boot. The (separate) cleaning process has to run after udev (because udev may be needed to mount /var filesystem) and thus we have to use a different flag until /var/lock is on a tmpfs. --- rc.d/init.d/network | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rc.d/init.d/network') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 95ed7be7..169a64e2 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -60,6 +60,18 @@ rc=0 case "$1" in start) [ "$EUID" != "0" ] && exit 4 + + # (cg) Note that using /var/lock/subsys/network as an indicator is not + # enough to prevent the udev net_action script kicking in on boot as + # /var/lock may be messy from the previous boot. + # The systemd service mandriva-clean-var-run-lock.service should tidy + # it up but it cannot run until after udev has started due to it being + # needed to mount /var filesystems. + # We can remove the hack below once /var/lock is a symlink to /run/lock + # which is on tmpfs and thus requires no cleaning. + # Please also see the corresponding code/comment in /lib/udev/net_action + touch /run/.mageia-network 2>/dev/null + rc=0 # IPv6 hook (pre IPv4 start) if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then -- cgit v1.2.1