aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-04-05 10:43:16 +0100
committerColin Guthrie <colin@mageia.org>2012-04-06 10:37:06 +0100
commit50d5be08ca006dcd367bdc9cd1ed894641e0bbff (patch)
tree71a2b3c8100b6a25c1291545e6a271ee9cea7eda
parent0830ab5148cea791a47f63947825870505a9d0d7 (diff)
downloadinitscripts-50d5be08ca006dcd367bdc9cd1ed894641e0bbff.tar
initscripts-50d5be08ca006dcd367bdc9cd1ed894641e0bbff.tar.gz
initscripts-50d5be08ca006dcd367bdc9cd1ed894641e0bbff.tar.bz2
initscripts-50d5be08ca006dcd367bdc9cd1ed894641e0bbff.tar.xz
initscripts-50d5be08ca006dcd367bdc9cd1ed894641e0bbff.zip
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.
-rwxr-xr-xrc.d/init.d/network12
1 files changed, 12 insertions, 0 deletions
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