NetworkManager.service 的作业失败,因为控制进程退出并显示错误代码

NetworkManager.service 的作业失败,因为控制进程退出并显示错误代码

我正在运行 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-eth0BOOTPROTO=dhcpBOOTPROTO=none

但我无法在系统上找到该文件。因此,我在根目录中尝试了此操作

$ ls -R | grep -i "BOOTPROTO"

但什么也没返回。

正如所建议的那样muru 的评论, 点击查看输出命令。由于太长,这里就不写了。

  1. 谁能告诉我到底发生了什么以及如何解决?

  2. 还有什么变化脚本导致了这个错误?

答案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.

相关内容