on  it road.com

解决方案

通常 Linux 操作系统不会自行关闭。
但是某些应用程序/实用程序确实如此。
由于每次在 auditd 守护进程启动时收到 TERM 信号,我们发现 auditd 守护进程具有在某些特定情况下停止 Linux 操作系统的功能。

“man auditd.conf”中的以下项目将在将值设置为“halt”时关闭 Linux OS。

  • space_left_action
  • admin_space_left_action
  • disk_full_action
  • 磁盘错误操作

在这种情况下,Linux 操作系统确实具有这些“停止”设置。

# cat /etc/audit/auditd.conf | grep halt
 admin_space_left_action = halt
 disk_full_action = halt
 disk_error_action = halt

而 /var/log/audit 的体积只有 6MB 可用空间。

/dev/mapper/vg_LogVol05  16040 428304 61524 88% /var/log/audit

这是当 auditd 发现空间问题或者磁盘错误时的预期行为,请相应地检查 Linux 操作系统。
如果我们不想让auditd 关闭Linux 操作系统,我们可以将“halt”修改为“syslog”,详情请参阅“man auditd.conf”。

# man auditd.conf

问题

Linux 操作系统启动失败,从控制台日志我们可以看到一开始一切顺利,内核加载和初始化脚本运行正常。
但是在 auditd 守护进程启动后,Linux 操作系统突然关闭(接收到 TERM 信号)。

...
dracut: Switching root
mount: mount point /proc/bus/usb does not exist
Welcome to Oracle Linux Server
Starting udev: udev: starting version 147
(snip)
Mounting local filesystems: EXT4-fs (xvda1): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (dm-4): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (dm-6): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (dm-9): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: (null)
[ OK ]
Enabling local filesystem quotas: [ OK ]
Enabling /etc/fstab swaps: Adding 16777212k swap on /dev/mapper/vg_ol68-LogVol08. Priority:-1 extents:1 across:16777212k SS
[ OK ]
Entering non-interactive startup
Starting OVM guest daemon: [ OK ]
Calling the system activity data collector (sadc)...
Starting monitoring for VG vg_ol68: 10 logical volume(s) in volume group "vg_ol68" monitored
[ OK ]
NET: Registered protocol family 10
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address x.x.x is already in use for device eth0...
[ OK ]
Starting auditd: type=1305 audit(1500420382.015:3): audit_pid=1626 old=0 auid=4294967295 ses=4294967295 res=1
init: rc main process (1341) killed by TERM signal   
[ OK ]

确认没有发生内核恐慌问题。
Linux 操作系统已经运行了好几天。
在问题之前没有人为操作/更改。

使用 Auditd ,无法启动 CentOS/RHEL 操作系统
日期:2020-09-17 00:12:44 来源:oir作者:oir