解决SELinux is preventing *** 的问题
生活随笔
收集整理的這篇文章主要介紹了
解决SELinux is preventing *** 的问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
解決SELinux is preventing systemd from read access on the file AB.sevice
問題描述
最近在公司做一個軟件遷移的工具時,將軟件的服務遷移之后,使用systemctl enable AB.service時報錯Failed to enable unit: Unit file *** does not exist。
排查過程
查看了/etc/systemd/system/ 下面的服務文件,文件存在,于是執行systemctl daemon-reload,發現還是不行。
后查看系統日志【/var/log/message】發現報錯信息SELinux is preventing systemd from read access on the file AB.sevice,定位問題為 SELinux 阻止 systemd 對文件AB.sevice進行讀取訪問。
最終解決方案
也可直接在配置文件【/etc/sysconfig/selinux】中設置SELinux=disabled,配置后需要重啟計算機,如果沒有時間重啟可以使用setenforce 0 暫時停止。
禁用SELinux 之后服務可以正常找到,到現在還不知道SELinux為什么要阻止對文件進行讀取訪問。有大佬知道的望評論指點迷津。
總結
以上是生活随笔為你收集整理的解决SELinux is preventing *** 的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (杂项笔记)关于电脑网卡冲突的问题
- 下一篇: [Linux] Linux文件系统