发生异常系统中断时,如果审计服务的审计文件仍处于打开状态,则审计服务将存在。或者,文件系统无法访问,强制系统切换到新文件系统。在这种情况下,尽管审计文件不再用于审计记录,但此文件仍然保留,并以字符串 not_terminated 作为结束时间戳。使用 auditreduce -O 命令可为此文件提供正确的时间戳。
开始之前
您必须是指定有 "Audit Review"(审计查看)权限配置文件的管理员。有关更多信息,请参见在 Oracle Solaris 11.2 中确保用户和进程的安全 中的使用所指定的管理权限。
# ls -R1t audit-directory */* | grep not_terminated
列出子目录中的文件。
按照从最新到最旧的顺序列出文件。
将文件列成一列。
对 auditreduce -O 命令指定旧文件的名称。
# auditreduce -O system-name old-not-terminated-file
# rm system-name old-not-terminated-file
在以下示例中,查找并重命名 not_terminated 文件,然后删除原始文件。
ls -R1t */* | grep not_terminated …/egret.1/20100908162220.not_terminated.egret …/egret.1/20100827215359.not_terminated.egret # cd */egret.1 # auditreduce -O egret 20100908162220.not_terminated.egret # ls -1t 20100908162220.not_terminated.egret Current audit file 20100827230920.20100830000909.egret Cleaned-up audit file 20100827215359.not_terminated.egret Input (old) audit file # rm 20100827215359.not_terminated.egret # ls -1t 20100908162220.not_terminated.egret Current audit file 20100827230920.20100830000909.egret Cleaned-up audit file
新文件的开始时间戳反映 not_terminated 文件中第一个审计事件的时间。结束时间戳反映此文件中最后一个审计事件的时间。