我读过很多关于这方面的文章,但仍然不知道为什么这不管用。据我所知,所有的and都有正确的权限,即使所有的东西都是777,在尝试以服务的形式运行这个程序时,我仍然被拒绝了。我试图作为服务器运行的程序称为xTeVe。我试过在所有不同的脏、用户下运行它,但是似乎没有什么能奏效。
这是该股的档案:
[Unit]
Description=XTeVe For Plex
After=network.target network-online.target
[Service]
ExecStart=/root/IPTV/xteve
user=root
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
我知道这不应该作为root运行,但这只是我最后一次尝试
当我尝试开始这项服务的时候,我得到了这样的信息:
14:20 xteve.service: Failed with result 'exit-code'.
14:02 xteve.service: Main process exited, code=exited, status=203/EXEC
14:02 xteve.service: Failed at step EXEC spawning /root/IPTV/xteve: Permission denied
14:02 xteve.service: Failed to execute command: Permission denied
14:02 Started XTeVe For Plex.
这是文件权限:
[root@skynet IPTV]# ls -la
total 12084
drwxr-xr-x. 2 root root 19 Mar 6 13:58 .
dr-xr-x---. 5 root root 175 Mar 6 13:58 ..
-rwxr-xr-x. 1 root root 12370316 Mar 6 13:58 xteve
file
的结果:
[root@skynet IPTV]# file xteve
xteve: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=lt4S9w02Ylf_MXsFeRkj/jdmwTx5YSsQSDaa6tfuz/vCzfZlCyl5qUEBD7IuD0/AEI-OmWm1iNuziWA7R0P, with debug_info, not stripped
cat audit.log | grep xteve
的输出:
type=AVC msg=audit(1551898814.098:1342): avc: denied { execute } for pid=11002 comm="(xteve)" name="xteve" dev="dm-0" ino=30958 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
type=SERVICE_STOP msg=audit(1551898814.100:1343): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=xteve comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'UID="root" AUID="unset"
type=SERVICE_START msg=audit(1551898814.420:1344): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=xteve comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'UID="root" AUID="unset"
type=SERVICE_STOP msg=audit(1551898814.420:1345): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=xteve comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'UID="root" AUID="unset"
type=SERVICE_START msg=audit(1551898966.689:1385): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=xteve comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=?res=success'UID="root" AUID="unset"
我试过但没有成功的事情:
发布于 2019-03-06 20:05:39
SELinux阻止您运行二进制文件位于用户主目录中的系统服务,或者在您的情况下是根用户的主目录。
要解决这个问题,请将二进制文件复制到适当的目录(如/usr/local/bin
),然后从那里调用它。
https://serverfault.com/questions/957084
复制相似问题