问题,网络初始化慢
解决方法
- 编辑配置文件
vim /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
- 添加内容
# 初始内容 [Service] Type=oneshot ExecStart=/lib/systemd/systemd-networkd-wait-online RemainAfterExit=yes
在Service下方添加:
# 两秒超时 TimeoutStartSec=2sec
- 完整内容
# SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Wait for Network to be Configured Documentation=man:systemd-networkd-wait-online.service(8) DefaultDependencies=no Conflicts=shutdown.target Requires=systemd-networkd.service After=systemd-networkd.service Before=network-online.target shutdown.target [Service] Type=oneshot ExecStart=/lib/systemd/systemd-networkd-wait-online RemainAfterExit=yes TimeoutStartSec=2sec [Install] WantedBy=network-online.target
- 重启验证
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/194646.html