debian系统应用进程启动失败问题分析

现象描述

设备网络灯显示异常,通过串口登录到设备,启动网络服务时,系统显示信息如下:

root@linux:~# systemctl start network_5g
[  OK  ] Stopped Emergency Shell.
[FAILED] Failed to mount /proc/bus/usb.
See 'systemctl status proc-bus-usb.mount' for details.
[DEPEND] Dependency failed for Local File Systems.
[  OK  ] Started Emergency Shell.
[  OK  ] Reached target Emergency Mode.
[  OK  ] Stopped Dispatch Password ts to Console Directory Watch.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Give root password for maintenance
(or press Control-D to continue):
Login incorrect

Give root password for maintenance
(or press Control-D to continue): 

输入root密码进入系统,执行journalctl -xb命令查看系统日志:

root@linux :/etc/systemd/system# journalctl -xe
Apr 06 10:14:59 linux mount[7779]: mount: /proc/bus/usb: mount point does not ex
Apr 06 10:14:59 linux systemd[1]: proc-bus-usb.mount: Failed with result 'exit-c
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit proc-bus-usb.mount has entered the 'failed' state with result 'exit-
Apr 06 10:14:59 linux systemd[1]: Failed to mount /proc/bus/usb.
-- Subject: A start job for unit proc-bus-usb.mount has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit proc-bus-usb.mount has finished with a failure.
-- 
-- The job identifier is 1055 and the job result is failed.
Apr 06 10:14:59 linux systemd[1]: Dependency failed for Local File Systems.
-- Subject: A start job for unit local-fs.target has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit local-fs.target has finished with a failure.
-- 
-- The job identifier is 1052 and the job result is dependency.
lines 1110-1132/1132 (END)

分析

从日志中可以看出,直接原因是挂载 /proc/bus/usb失败,进而导致内核文件系统失败,

在systemd-remount-fs中是负责对/etc/fstab文件中解析的:

root@linux:/etc/systemd/system# systemctl status sresytemstemd-remoni=ount-fs.
 systemd-remount-fs.service - Remount Root and Kernel File Systems
   Loaded: loaded (/lib/systemd/system/systemd-remount-fs.service; static; vendo
   Active: active (exited) since Fri 2023-03-17 03:14:52 UTC; 2 weeks 6 days ago
     Docs: man:systemd-remount-fs.service(8)
           https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
 Main PID: 141 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/systemd-remount-fs.service

Warning: Journal has been rotated since unit was started. Log output is incomple
lines 1-9/9 (END)

 root@jenet:/etc/systemd/system# journalctl -xe
Apr 06 10:14:59 linux mount[7779]: mount: /proc/bus/usb: mount point does not ex
Apr 06 10:14:59 linux systemd[1]: proc-bus-usb.mount: Failed with result 'exit-c
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit proc-bus-usb.mount has entered the 'failed' state with result 'exit-
Apr 06 10:14:59 linux systemd[1]: Failed to mount /proc/bus/usb.
-- Subject: A start job for unit proc-bus-usb.mount has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit proc-bus-usb.mount has finished with a failure.
-- 
-- The job identifier is 1055 and the job result is failed.
Apr 06 10:14:59 linux systemd[1]: Dependency failed for Local File Systems.
-- Subject: A start job for unit local-fs.target has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit local-fs.target has finished with a failure.
-- 
-- The job identifier is 1052 and the job result is dependency.
lines 1110-1132/1132 (END)

确实是 systemd-remount-fs服务启动失败导致的,查看/etc/fstab文件内容如下:

# UNCONFIGURED FSTAB FOR BASE SYSTEM
tmpfs /tmp tmpfs rw,nodev,size=1024m 0 0
/dev/mmcblk0p7 /linkedge ext4 defaults 0 0
/dev/mmcblk0p8 /config/worka ext4 defaults 0 0
/dev/mmcblk0p9 /config/workb ext4 defaults 0 0
/dev/mmcblk0p10 /config/work ext4 defaults 0 0
/dev/mmcblk0p11 /jetron/da ext4 defaults 0 0
/dev/mmcblk0p12 /config/log ext4 defaults 0 0
/dev/mmcblk0p13 /app ext4 defaults 0 0
none /proc/bus/usb usbfs defaults

出现了一条异常记录,将该条记录删除后,系统应用能正常启动,目前还不确定是谁向该文件中写入了此条记录。 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李小白20200202

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值