【发布时间】:2020-06-07 03:01:28
【问题描述】:
请问,您知道如何解决此问题吗? 我到处找都没找到。
06:45 SELinux is preventing systemd from open access on the file /root/.pm2/pm2.pid. For complete SELinux messages run: sealert -l d84a5a0b-cfcf-4cb9-918a-c0952bf70600 setroubleshoot
06:45 pm2-root.service: Can't convert PID files /root/.pm2/pm2.pid O_PATH file descriptor to proper file descriptor: Permission denied systemd 2
06:45 Failed to start PM2 process manager.
我已经执行了这个命令: sealert -l d84a5a0b-cfcf-4cb9-918a-c0952bf70600 setroubleshoot
Messages d'audit bruts
type=AVC msg=audit(1591498085.184:7731): avc: denied { open } for pid=1 comm="systemd" path="/root/.pm2/pm2.pid" dev="dm-0" ino=51695937 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:admin_home_t:s0 tclass=file permissive=0
PM2 版本:4.4.0 节点版本:12.18.0 CentOS 版本:8
我的系统服务:
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target
[Service]
Type=forking
User=root
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/sbin:/bin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/root/.pm2
PIDFile=/root/.pm2/pm2.pid
Restart=on-failure
ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill
[Install]
WantedBy=multi-user.target
谢谢
【问题讨论】:
-
我遇到了完全相同的问题。你解决了吗?
-
永远使用...
-
是的,我也考虑过...但是我还没有完成。我目前正在研究如何解除 SELinux 限制。这似乎是可能的,因为它是针对类似问题完成的:digitalocean.com/community/tutorials/…。不过,该命令有点神秘:
chcon -vR system_u:object_r:httpd_sys_content_t:s0 /var/www/your_domain/ -
我终于找到了...我在这里发布答案