代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/initscripts 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ad95c2dae06794a37e500e07e13cee8328ddfb5d Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 24 Sep 2019 17:39:52 +0800
Subject: [PATCH] initscripts: add network start dhcp process background
reason:add network start dhcp process background
Signed-off-by: rpm-build <rpm-build>
---
etc/rc.d/init.d/network | 36 +++++++++++++++++++++++++++++++-----
1 file changed, 31 insertions(+), 5 deletions(-)
diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network
index 31bbe20..994425d 100755
--- a/etc/rc.d/init.d/network
+++ b/etc/rc.d/init.d/network
@@ -49,6 +49,8 @@ interfaces=$(ls ifcfg-* | \
LC_ALL=C sed 's/ //')
rc=0
+godamon=0
+
net_log $"You are using 'network' service provided by 'network-scripts', which are now deprecated." warning network >&2
net_log $"'network-scripts' will be removed from distribution in near future." warning network >&2
net_log $"It is advised to switch to 'NetworkManager' instead for network management." warning network >&2
@@ -129,18 +131,39 @@ start)
is_available $i
continue
fi
- action $"Bringing up interface $i: " ./ifup $i boot
- [ $? -ne 0 ] && rc=1
+ if [ "$godamon" != "1" ] ; then
+ action $"Bringing up interface $i: " ./ifup $i boot
+ [ $? -ne 0 ] && rc=1
+ else
+ action $"Bringing up interface $i: " ./ifup $i boot &
+ fi
done
# Bring up xDSL and VPN interfaces
for i in $vlaninterfaces $bridgeinterfaces $xdslinterfaces $vpninterfaces ; do
if ( . ./ifcfg-"$i" ; ! is_false "$ONBOOT" ) ; then
- action $"Bringing up interface $i: " ./ifup $i boot
- [ $? -ne 0 ] && rc=1
+ if [ "$godamon" != "1" ] ; then
+ action $"Bringing up interface $i: " ./ifup $i boot
+ [ $? -ne 0 ] && rc=1
+ else
+ action $"Bringing up interface $i: " ./ifup $i boot &
+ fi
fi
done
-
+ # Waiting until all background process done
+ if [ "$godamon" = "1" ] ; then
+ for pid in $(jobs -p)
+ do
+ wait $pid
+ status=$?
+ if [ $status != 0 ] ;then
+ net_log "Unable to obtain DHCP addresas."
+ rc=1
+ continue
+ fi
+ rc=0
+ done
+ fi
# Add non interface-specific static-routes.
if [ -f /etc/sysconfig/static-routes ]; then
if [ -x /sbin/route ]; then
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。