auditd.service control process exited linux审计服务启动失败 您所在的位置:网站首页 linux重启失败怎么办 auditd.service control process exited linux审计服务启动失败

auditd.service control process exited linux审计服务启动失败

2023-07-25 22:57| 来源: 网络整理| 查看: 265

auditd.service control process exited linux审计服务启动失败(Centos7)

systemctl restart auditd systemctl restart auditd.service

报错如下:

Failed to restart auditd.service: Operation refused, unit auditd.service may be requested by dependency only (it is configured to refuse manual start/stop). See system logs and 'systemctl status auditd.service' for details.

service restart auditd //尝试用此命令重启 在这里插入图片描述

报错如下: Stopping logging: [FAILED] Redirecting start to /bin/systemctl start auditd.service Job for auditd.service failed because the control process exited with error code. See "systemctl status auditd.service" and "journalctl -xe" for details.

journalctl -xe //查看报错 在这里插入图片描述

报错信息: Value 30MB should only be numbers - line 38 auditd[32156]: Value 30MB should only be numbers - line 38 auditd[32156]: The audit daemon is exiting. systemd[1]: auditd.service: control process exited, code=exited status=6 systemd[1]: Failed to start Security Auditing Service. -- Subject: Unit auditd.service has failed

vim /etc/audit/auditd.conf //查看配置文件的详细信息 set nu 发现配置文件中 配置参数 max_log_file //有两行 在这里插入图片描述

解决方案:

vim /etc/audit/auditd.conf 注释掉 max_log_file = 30 MB service auditd restart //重启该服务、(执行此命令两次) service auditd status //查看服务状态 在这里插入图片描述

配置文件详解

/etc/audit/auditd.conf存放在配置文件,决定auditd程序的行为,对其中一些重要的选项进行说明:

log_file 指定log文件存放的位置 max_log_file 指定单个log文件的最大大小,单位是Mbyte max_log_file_action 当log文件达到max_log_file设定的大小时执行的动作,可选的动作 有:ignore/syslog/suspend/rotate, ignore表示忽略max_log_file设置的限制,继续写log文件,syslog表示会向syslog中写入一条warning,suspend表示auditd不再写log文件,但是auditd继续运行,rotate表示分多个log文件,一个log文件达到上限后在创建一个新的不同名字的log文件,后面会继续讲解该选项。 space_left 表示log_file 文件所在的分区空闲空间少于这个设定的值时,触发相应的动作,单位是Mbyte space_left_action 指定space_left触发后执行的动作,可选的选项有:ignore/syslog/suspend/single/halt,前面三个选项与max_log_file_action相似,single表示audit进程会将系统模式变为单用户模式,halt表示audit进程将会触发系统关机 admin_space_left 系统管理员用户对于的空间,space_left讲的是普通用户 admin_space_left_action 与space_left_action类似,但是对于系统管理员 disk_full_action 磁盘满了之后应该采取的动作 disk_error_action 磁盘写错误之后应该采取的动作 flush 表示日志文件的刷新方式,可选的选项有:NONE、INCREMENTAL、DATA和SYNC,如果设置为NONE,则不需要做特殊努力来将数据刷新到日志文件中。如果设置为INCREMENTAL,则用freq选项的值确定多长时间发生一次向磁盘的刷新。如果设置为DATA,则审计数据和日志文件一直是同步的。如果设置为SYNC,则每次写到日志文件时,数据和元数据是同步的。 num_logs 表示保留日志文件的最大个数,只有在max_log_file_action=rotate时该选项该有意义,必须是0~99之间的数。如果设置为小于2,则不会循环日志。如果递增了日志文件的数目,就可能有必要递增/etc/audit/audit.rules中的内核backlog设置值,以便留出日志循环的时间。如果没有设置num_logs值,它就默认为0,意味着从来不循环日志文件。当达到指定文件容量后会循环日志文件,但是只会保存一定数目的老文件,这个数目由num_logs参数指定。老文件的文件名将为audit.log.N,其中 N是一个数字。这个数字越大,则文件越老。 配置文件详解请参考

Linux audit详解: https://blog.csdn.net/whuzm08/article/details/87267956



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有