我正在运行 Ubuntu 16.04 KDE。请参阅此处了解规格。
$ uname -a
Linux ElMaverick 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 16.04.1 LTS \n \l
每次挂起后,当我唤醒笔记本电脑时,它都不会连接到任何网络,必须重新启动 NetworkManager。所以,出于懒惰,我写了这个脚本效果非常好。
然后我将脚本编辑为muru 建议在这里在回答 2 周前提出的问题时。当我执行此脚本时,它显示此错误
Job for NetworkManager.service failed because the control process exited with error code. See "systemctl status NetworkManager.service" and "journalctl -xe" for details.
错误提示的命令输出如下:
systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Mon 2018-01-29 10:00:51 IST; 14s ago
Process: 25388 ExecStart=/usr/sbin/NetworkManager --no-daemon (code=exited, status=1/FAILURE)
Main PID: 25388 (code=exited, status=1/FAILURE)
Jan 29 10:00:51 ElMaverick systemd[1]: Failed to start Network Manager.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Unit entered failed state.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Service hold-off time over, scheduling restart.
Jan 29 10:00:51 ElMaverick systemd[1]: Stopped Network Manager.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Start request repeated too quickly.
Jan 29 10:00:51 ElMaverick systemd[1]: Failed to start Network Manager.
journalctl-xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit NetworkManager.service has finished shutting down.
Jan 29 10:00:51 ElMaverick systemd[1]: Starting Network Manager...
-- Subject: Unit NetworkManager.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit NetworkManager.service has begun starting up.
Jan 29 10:00:51 ElMaverick NetworkManager[25388]: NetworkManager is already running (pid 20138)
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Main process exited, code=exited, status=1/FAILURE
Jan 29 10:00:51 ElMaverick systemd[1]: Failed to start Network Manager.
-- Subject: Unit NetworkManager.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit NetworkManager.service has failed.
--
-- The result is failed.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Unit entered failed state.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Service hold-off time over, scheduling restart.
Jan 29 10:00:51 ElMaverick systemd[1]: Stopped Network Manager.
-- Subject: Unit NetworkManager.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit NetworkManager.service has finished shutting down.
Jan 29 10:00:51 ElMaverick systemd[1]: NetworkManager.service: Start request repeated too quickly.
Jan 29 10:00:51 ElMaverick systemd[1]: Failed to start Network Manager.
-- Subject: Unit NetworkManager.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit NetworkManager.service has failed.
--
-- The result is failed.
lines 1356-1393/1393 (END)
这个问题有点类似,但不幸的是没有答案。
类似问题在这里建议更改文件中的参数
/etc/sysconfig/network-scripts/ifcfg-eth0
从BOOTPROTO=dhcp
到BOOTPROTO=none
。
但我无法在系统上找到该文件。因此,我在根目录中尝试了此操作
$ ls -R | grep -i "BOOTPROTO"
但什么也没返回。
答案1
我遇到了同样的问题,然后我尝试运行这个命令:
sudo snap install hello-world
并再次启动 snapd.seeded.service 进程:
systemctl start snapd.seeded.service
之后你可以验证是否snmp.seeded.service
运行顺利:
$ systemctl status snapd.seeded.service
● snapd.seeded.service - Wait until snapd is fully seeded
Loaded: loaded (/lib/systemd/system/snapd.seeded.service; enabled; vendor preset: enabled)
Active: active (exited) since xxx 2018-xx-xx xx:12:xx xxx; xxx ago
Process: 26925 ExecStart=/usr/bin/snap wait system seed.loaded (code=exited, status=0/SUCCESS)
Main PID: 26925 (code=exited, status=0/SUCCESS)
xxx xx xx:xx:xx xxx systemd[1]: Starting Wait until snapd is fully seeded...
xxx xx xx:xx:xx xxx systemd[1]: Started Wait until snapd is fully seeded.
xxx xx xx:xx:xx xxx systemd[1]: Started Wait until snapd is fully seeded.