继上次发现的这个问题 xubuntu系统偶发自动登出,这次问题又浮现了,我第一时间拷贝了系统日志。
为了减少搜索量,可以先清除之前的系统日志,待问题出现
echo > /var/log/syslog
echo > /var/log/kern.log
Mar 21 15:07:58 aubo-384519007 obexd[7066]: Terminating
Mar 21 15:08:00 aubo-384519007 systemd[1]: Created slice User Slice of lightdm.
Mar 21 15:08:00 aubo-384519007 systemd[1]: Starting User Manager for UID 108...
Mar 21 15:08:00 aubo-384519007 systemd[1]: Started Session c8 of user lightdm.
Mar 21 15:08:00 aubo-384519007 systemd[8071]: Reached target Sockets.
Mar 21 15:08:00 aubo-384519007 systemd[8071]: Reached target Timers.
Mar 21 15:08:00 aubo-384519007 systemd[8071]: Reached target Paths.
Mar 21 15:08:00 aubo-384519007 systemd[8071]: Reached target Basic System.
Mar 21 15:08:00 aubo-384519007 systemd[8071]: Reached target Default.
Mar 21 15:08:00 aubo-384519007 systemd[8071]: Startup finished in 209ms.
Mar 21 15:08:00 aubo-384519007 systemd[1]: Started User Manager for UID 108.
Mar 21 15:08:00 aubo-384519007 org.a11y.atspi.Registry[8113]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Mar 21 15:08:01 aubo-384519007 rtkit-daemon[2772]: Successfully made thread 8159 of process 8159 (n/a) owned by '108' high priority at nice level -11.
Mar 21 15:08:01 aubo-384519007 rtkit-daemon[2772]: Supervising 1 threads of 1 processes of 1 users.
Mar 21 15:08:01 aubo-384519007 rtkit-daemon[2772]: Supervising 1 threads of 1 processes of 1 users.
Mar 21 15:08:01 aubo-384519007 rtkit-daemon[2772]: Successfully made thread 8163 of process 8159 (n/a) owned by '108' RT at priority 5.
Mar 21 15:08:01 aubo-384519007 rtkit-daemon[2772]: Supervising 2 threads of 1 processes of 1 users.
Mar 21 15:10:23 aubo-384519007 kernel: [20501.873533] usb 1-1: new high-speed USB device number 44 using xhci_hcd
Mar 21 15:10:23 aubo-384519007 kernel: [20502.023881] usb 1-1: New USB device found, idVendor=090c, idProduct=2000
Mar 21 15:10:23 aubo-384519007 kernel: [20502.023887] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 21 15:10:23 aubo-384519007 kernel: [20502.023890] usb 1-1: Product: HIKSEMI
Mar 21 15:10:23 aubo-384519007 kernel: [20502.023892] usb 1-1: SerialNumber: 2294921051130675867
Mar 21 15:10:23 aubo-384519007 mtp-probe: checking bus 1, device 44: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1"
Mar 21 15:10:23 aubo-384519007 mtp-probe: bus: 1, device: 44 was not an MTP device
Mar 21 15:10:23 aubo-384519007 kernel: [20502.056585] usb-storage 1-1:1.0: USB Mass Storage device detected
Mar 21 15:10:23 aubo-384519007 kernel: [20502.056990] scsi host2: usb-storage 1-1:1.0
Mar 21 15:10:23 aubo-384519007 kernel: [20502.059335] usbcore: registered new interface driver usb-storage
Mar 21 15:10:23 aubo-384519007 kernel: [20502.063571] usbcore: registered new interface driver uas
Mar 21 15:10:24 aubo-384519007 kernel: [20503.083348] scsi 2:0:0:0: Direct-Access HIKSEMI 2.00 PQ: 0 ANSI: 4
Mar 21 15:10:24 aubo-384519007 kernel: [20503.084364] sd 2:0:0:0: Attached scsi generic sg1 type 0
Mar 21 15:10:24 aubo-384519007 kernel: [20503.084503] sd 2:0:0:0: [sdb] 15728640 512-byte logical blocks: (8.05 GB/7.50 GiB)
Mar 21 15:10:24 aubo-384519007 kernel: [20503.084659] sd 2:0:0:0: [sdb] Write Protect is off
Mar 21 15:10:24 aubo-384519007 kernel: [20503.084663] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
Mar 21 15:10:24 aubo-384519007 kernel: [20503.084811] sd 2:0:0:0: [sdb] No Caching mode page found
Mar 21 15:10:24 aubo-384519007 kernel: [20503.084820] sd 2:0:0:0: [sdb] Assuming drive cache: write through
Mar 21 15:10:24 aubo-384519007 kernel: [20503.091161] sdb:
Mar 21 15:10:24 aubo-384519007 kernel: [20503.097186] sd 2:0:0:0: [sdb] Attached SCSI removable disk
Mar 21 15:10:39 aubo-384519007 org.gtk.vfs.Daemon[8093]: A connection to the bus can't be made
Mar 21 15:10:39 aubo-384519007 systemd[1]: Created slice User Slice of aubo.
Mar 21 15:10:39 aubo-384519007 systemd[1]: Starting User Manager for UID 1000...
Mar 21 15:10:40 aubo-384519007 systemd[1]: Started Session c9 of user aubo.
Mar 21 15:10:40 aubo-384519007 systemd[8202]: Reached target Timers.
Mar 21 15:10:40 aubo-384519007 systemd[8202]: Reached target Paths.
Mar 21 15:10:40 aubo-384519007 systemd[8202]: Reached target Sockets.
Mar 21 15:10:40 aubo-384519007 systemd[8202]: Reached target Basic System.
Mar 21 15:10:40 aubo-384519007 systemd[8202]: Reached target Default.
Mar 21 15:10:40 aubo-384519007 systemd[8202]: Startup finished in 206ms.
Mar 21 15:10:40 aubo-384519007 systemd[1]: Started User Manager for UID 1000.
Mar 21 15:10:48 aubo-384519007 rtkit-daemon[2772]: Successfully made thread 8436 of process 8436 (n/a) owned by '1000' high priority at nice level -11.
Mar 21 15:10:48 aubo-384519007 rtkit-daemon[2772]: Supervising 3 threads of 2 processes of 2 users.
Mar 21 15:10:48 aubo-384519007 org.a11y.Bus[8298]: Activating service name='org.a11y.atspi.Registry'
Mar 21 15:10:48 aubo-384519007 org.a11y.Bus[8298]: ** (process:8427): WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
Mar 21 15:10:48 aubo-384519007 org.a11y.Bus[8298]: Successfully activated service 'org.a11y.atspi.Registry'
Mar 21 15:10:48 aubo-384519007 org.a11y.atspi.Registry[8451]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Mar 21 15:10:48 aubo-384519007 rtkit-daemon[2772]: Supervising 3 threads of 2 processes of 2 users.
Mar 21 15:10:48 aubo-384519007 rtkit-daemon[2772]: Successfully made thread 8467 of process 8436 (n/a) owned by '1000' RT at priority 5.
Mar 21 15:10:48 aubo-384519007 rtkit-daemon[2772]: Supervising 4 threads of 2 processes of 2 users.
Mar 21 15:10:48 aubo-384519007 rtkit-daemon[2772]: Successfully made thread 8469 of process 8469 (n/a) owned by '1000' high priority at nice level -11.
Mar 21 15:10:48 aubo-384519007 rtkit-daemon[2772]: Supervising 5 threads of 3 processes of 2 users.
Mar 21 15:10:48 aubo-384519007 pulseaudio[8469]: [pulseaudio] pid.c: Daemon already running.
Mar 21 15:10:49 aubo-384519007 obexd[8508]: OBEX daemon 5.37
Mar 21 15:10:49 aubo-384519007 org.gtk.vfs.AfcVolumeMonitor[8298]: Volume monitor alive
Mar 21 15:10:49 aubo-384519007 systemd[1]: Started CUPS Scheduler.
Mar 21 15:10:49 aubo-384519007 dbus[735]: [system] Activating service name='org.blueman.Mechanism' (using servicehelper)
Mar 21 15:10:50 aubo-384519007 org.blueman.Mechanism[735]: Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Mar 21 15:10:50 aubo-384519007 org.blueman.Mechanism[735]: Unable to init server: Could not connect: Connection refused
Mar 21 15:10:50 aubo-384519007 org.blueman.Mechanism[735]: Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Mar 21 15:10:50 aubo-384519007 org.blueman.Mechanism[735]: Unable to init server: Could not connect: Connection refused
Mar 21 15:10:50 aubo-384519007 blueman-mechanism: Starting blueman-mechanism
Mar 21 15:10:50 aubo-384519007 dbus[735]: [system] Successfully activated service 'org.blueman.Mechanism'
Mar 21 15:10:50 aubo-384519007 org.blueman.Mechanism[735]: (blueman-mechanism:8525): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
Mar 21 15:10:50 aubo-384519007 blueman-mechanism: loading Ppp
Mar 21 15:10:50 aubo-384519007 blueman-mechanism: loading Rfcomm
Mar 21 15:10:50 aubo-384519007 blueman-mechanism: loading RfKill
Mar 21 15:10:50 aubo-384519007 blueman-mechanism: loading Network
Mar 21 15:11:00 aubo-384519007 systemd[1]: Stopping User Manager for UID 108...
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Stopped target Default.
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Stopped target Basic System.
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Stopped target Paths.
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Reached target Shutdown.
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Starting Exit the Session...
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Stopped target Sockets.
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Stopped target Timers.
Mar 21 15:11:00 aubo-384519007 systemd[8071]: Received SIGRTMIN+24 from PID 8553 (kill).
Mar 21 15:11:00 aubo-384519007 systemd[1]: Stopped User Manager for UID 108.
Mar 21 15:11:00 aubo-384519007 systemd[1]: Removed slice User Slice of lightdm.
Mar 21 15:11:01 aubo-384519007 kernel: [20539.684121] FAT-fs (sdb): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Mar 21 15:11:01 aubo-384519007 udisksd[1456]: Mounted /dev/sdb at /media/aubo/1604 on behalf of uid 1000
最后一行是我插入了U盘1604去拷贝日志的,基本判定问题出在之前,意思大概是 lightdm
软件被系统杀了,而 lightdm
又是桌面显示管理器,被杀了就能解释的通为何系统登出,从root用户直接跳到普通用户登录界面了。
显示管理器(display manager),用于开机后显示登陆界面,并启动窗口管理器等X组件。没有显示管理器,Linux开机会显示命令行登陆界面,需要使用命令行登陆后手动启动Xserver和窗口管理器才能显示GUI,显示管理器自动的完成这些工作,常见的有GDM、LightDM、DDM。
LightDM是运行在Debian系列操作系统上的桌面显示管理器,它的全名是Light Display Manager,表面含义是轻量级桌面显示管理器。
LightDM详细介绍
网上搜了一大圈,可能是由于系统资源紧缺时杀掉lightdm
进程,解决办法:
修改 /etc/systemd/logind.conf
文件,
KillUserProcesses=no
实际效果待验证。。。
关于 logind.conf 文件的说明
http://www.jinbuguo.com/systemd/logind.conf.html
https://blog.csdn.net/dkx523121943/article/details/81545799
参考:
linux用户进程执行过程被系统kill掉了
https://github.com/shadowsocks/shadowsocks-manager/issues/438
ubuntu16.04系统资源紧缺时杀掉session进程
https://www.cnblogs.com/sparkdev/p/12146305.html