summaryrefslogtreecommitdiff
path: root/net.Linux
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-30 15:57:01 +0000
committerRoy Marples <roy@marples.name>2008-01-30 15:57:01 +0000
commitee44b907957f02f2d5b5f25da663ee90df6c41b3 (patch)
tree37db5c2f03debd762f56af32f60673c38b5b2dee /net.Linux
parent84ad9a40a647b97551bc8bc35f082bd82e8b8c92 (diff)
downloadopenrc-ee44b907957f02f2d5b5f25da663ee90df6c41b3.tar.gz
openrc-ee44b907957f02f2d5b5f25da663ee90df6c41b3.tar.bz2
openrc-ee44b907957f02f2d5b5f25da663ee90df6c41b3.tar.xz
Add a timeout for creating tun/tap interfaces.
Diffstat (limited to 'net.Linux')
-rw-r--r--net.Linux/tuntap.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/net.Linux/tuntap.sh b/net.Linux/tuntap.sh
index 6200813..bd494db 100644
--- a/net.Linux/tuntap.sh
+++ b/net.Linux/tuntap.sh
@@ -25,6 +25,18 @@ tuntap_pre_start()
eerror "TUN/TAP support is not present in this kernel"
return 1
fi
+ vebegin "Waiting for /dev/net/tun"
+ # /dev/net/tun can take it's time to appear
+ local timeout=10
+ while [ ! -e /dev/net/tun -a ${timeout} -gt 0 ]; do
+ sleep 1
+ timeout=$((${timeout} - 1))
+ done
+ if [ ! -e /dev/net/tun ]; then
+ eerror "TUN/TAP support present but /dev/net/tun is not"
+ return 1
+ fi
+ veend 0
fi
ebegin "Creating Tun/Tap interface ${IFACE}"