linux su命令卡顿 ssh卡顿

本文详细讲述了Linux环境下su命令执行缓慢的问题,通过strace跟踪发现是由于ABRT服务中的子进程abrt-cli卡顿。文章介绍了如何定位问题,包括查看进程状态、重启dbus服务,最终解决了卡顿问题。
摘要由CSDN通过智能技术生成



linux su命令卡顿,linux su特别慢问题排查_徐枭涵的博客-CSDN博客

SSH登录时间久,登录后报错:'abrt-cli status' timed out - seabiscuit0922 - 博客园

[root@wcrma904 ~]# strace -tt su -
14:27:07.595123 execve("/bin/su", ["su", "-"], [/* 27 vars */]) = 0
14:27:07.595717 brk(0)                  = 0x7f5fb1c7f000
14:27:07.595847 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5fb0c79000
14:27:07.595907 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
14:27:07.595984 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
14:27:07.596028 fstat(3, {st_mode=S_IFREG|0644, st_size=78699, ...}) = 0
14:27:07.596069 mmap(NULL, 78699, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5fb0c65000
14:27:07.596101 close(3)                = 0
14:27:07.596147 open("/lib64/libpam.so.0", O_RDONLY|O_CLOEXEC) = 3
14:27:07.596189 read(3, "\177ELF\2

14:27:07.657703 recvfrom(4, "$\0\0\0\2\0\0\0\4\0\0\0_N\0\0\0\0\0\0\274\0\0\0Q\4\5\0\4\0\0\0"..., 8988, MSG_PEEK|MSG_DONTWAIT, {sa_family=AF_NETLINK, pid=0, groups=00000000}, [12]) = 36
14:27:07.657732 recvfrom(4, "$\0\0\0\2\0\0\0\4\0\0\0_N\0\0\0\0\0\0\274\0\0\0Q\4\5\0\4\0\0\0"..., 8988, MSG_DONTWAIT, {sa_family=AF_NETLINK, pid=0, groups=00000000}, [12]) = 36
14:27:07.657762 close(4)                = 0
14:27:07.657787 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f5fb0c61a10) = 20064
14:27:07.658144 chdir("/")              = 0
14:27:07.658169 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], NULL, 8) = 0
14:27:07.658197 rt_sigaction(SIGTERM, {0x7f5fb0c7f940, [], SA_RESTORER, 0x7f5fb02ba670}, NULL, 8) = 0
14:27:07.658224 rt_sigprocmask(SIG_UNBLOCK, [ALRM TERM], NULL, 8) = 0
14:27:07.658247 wait4(20064, [root@wcrma904 ~]# 

发现在等待20064这个进程

查看这个进程是什么

[root@wcrma904 ~]# ps -ef|grep 20064
root     20064 20063  0 14:27 pts/3    00:00:00 -bash
root     20077 20064  0 14:27 pts/3    00:00:00 abrt-cli status --since=1637648403
root     20518 12625  0 14:27 pts/4    00:00:00 grep --color=auto 20064
[root@wcrma904 ~]# top

是abrt-cli卡住 用下面命令查看状态

systemctl status abrtd.service

[root@wcrma904 ~]# systemctl status abrtd.service
● abrtd.service - ABRT Automated Bug Reporting Tool
   Loaded: loaded (/usr/lib/systemd/system/abrtd.service; enabled; vendor preset: enabled)
   Active: active (running) since 日 2021-08-01 22:46:41 CST; 3 months 22 days ago
 Main PID: 1184 (abrtd)
   CGroup: /system.slice/abrtd.service
           ├─ 1184 /usr/sbin/abrtd -d -s
           ├─ 7193 abrt-server -s
           ├─ 7237 /usr/libexec/abrt-handle-event -i -e post-create -- /var/spool/abrt/ccpp-2021-10-26-15:07:24-6449
           ├─10405 abrt-server -s
           ├─10406 /usr/libexec/abrt-handle-event -i -e post-create -- /var/spool/abrt/ccpp-2021-10-26-15:08:57-9943
           ├─18761 abrt-server -s
           └─18762 /usr/libexec/abrt-handle-event -i -e post-create -- /var/spool/abrt/ccpp-2021-11-23-13:56:57-1776

11月 23 14:30:04 wcrma904 abrt-server[18761]: Lock file '.lock' is locked by process 10404
11月 23 14:30:04 wcrma904 abrt-server[10405]: Lock file '.lock' is locked by process 10404
11月 23 14:30:04 wcrma904 abrt-server[7193]: Lock file '.lock' is locked by process 10404
11月 23 14:30:04 wcrma904 abrt-server[18761]: Lock file '.lock' is locked by process 10404
11月 23 14:30:05 wcrma904 abrt-server[10405]: Lock file '.lock' is locked by process 10404
11月 23 14:30:05 wcrma904 abrt-server[7193]: Lock file '.lock' is locked by process 10404
11月 23 14:30:05 wcrma904 abrt-server[18761]: Lock file '.lock' is locked by process 10404
11月 23 14:30:05 wcrma904 abrt-server[10405]: Lock file '.lock' is locked by process 10404
11月 23 14:30:05 wcrma904 abrt-server[7193]: Lock file '.lock' is locked by process 10404
11月 23 14:30:05 wcrma904 abrt-server[18761]: Lock file '.lock' is locked by process 10404
[root@wcrma904 ~]# 
[root@wcrma904 ~]# ps aux|grep 10404
root     10404  0.0  0.0 106868  4176 ?        S    10月26   1:33 /usr/libexec/abrt-hook-ccpp 6 0 9943 1001 1001 1635232137 e 9943 9943
root     23951  0.0  0.0 112664   964 pts/3    S+   14:30   0:00 grep --color=auto 10404
[root@wcrma904 ~]# 
[root@wcrma904 ~]# kill -9 10404
[root@wcrma904 ~]# su -
上一次登录:二 11月 23 14:27:07 CST 2021pts/3 上
[root@wcrma904 ~]# 

然后就不卡了

22.08.26 1:30 来电说10.4.151.100卡顿,这次跟上次不一样后来这样解决

重启dbus

systemctl restart dbus

原文:

linux su命令卡顿,linux su特别慢问题排查_徐枭涵的博客-CSDN博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值