1 systemct start failed
1、R9 x86环境systemctl启动失败
1
2
3
4
5
6
7
8
9
10
11
12
13
14
● numad.service - numad - The NUMA daemon that manages application locality.
Loaded: loaded (/usr/lib/systemd/system/numad.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-09-16 11:08:09 CST; 2min 17s ago
Docs: man:numad
Process: 618176 ExecStart=/usr/bin/numad -i 15 (code=exited, status=1/FAILURE)
Sep 16 11:08:09 localhost.localdomain systemd[1]: Starting numad - The NUMA daemon that manages application locality....
Sep 16 11:08:09 localhost.localdomain numad[618176]: Wed Sep 16 11:08:09 2020: Cannot open numad log file (errno: 13) -- using stderr
Sep 16 11:08:09 localhost.localdomain numad[618176]: Wed Sep 16 11:08:09 2020: msgget failed
Sep 16 11:08:09 localhost.localdomain systemd[1]: numad.service: Control process exited, code=exited, status=1/FAILURE
Sep 16 11:08:09 localhost.localdomain systemd[1]: numad.service: Failed with result 'exit-code'.
Sep 16 11:08:09 localhost.localdomain systemd[1]: Failed to start numad - The NUMA daemon that manages application locality..
[root@localhost testEL_Numad_FUN.001]# systemctl start numad
Job for numad.service failed because the control process exited with error code.
查看numad的代码:https://pagure.io/numad/blob/master/f/numad.c
1
2
3
4
5
6
7
8
9
10
// errno:13 - #define EACCES 13 /* Permission denied */
#define VAR_LOG_FILE "/var/log/numad.log"
void open_log_file() {
log_fs = fopen(VAR_LOG_FILE, "a");
if (log_fs == NULL) {
log_fs = stderr;
numad_log(LOG_ERR, "Cannot open numad log file (errno: %d) -- using stderr\n", errno);
}
}
发现失败原因是,fopen(“/var/log/numad.log”, “a”)没有权限。
查看audit的日志发现fopen失败;
selinux维护了一个系统的访问权限表 access vector cache;
auditd服务会监控所有的异常访问 记到audit日志里面
将selinux关闭后,通过systemd启动正常;
打开selinux,通过systemd启动失败,只能手动直接命令,绕过systemd audit审计。