Service xxx does not have a SELinux domain defined.权限问题

匿名 (未验证) 提交于 2019-12-02 21:59:42

init: Service xxx does not have a SELinux domain defined.

该提示说明没有定义SELinux domain,导致服务xxx无法自启动。为了解决这个问题我们按如下方式修改或添加sepolicy文件:


修改system/seplicy/file_contexts文件,添加以下内容:

/system/bin/xxx u:object_r:xxx_exec:s0

新增xxx.te文件,并在其中添加如下内容:

xxx, domain;

xxx_exec, exec_type, file_type;

allow idmap resource_cache_data_file:dir rw_dir_perms;

allow idmap resource_cache_data_file:file create_file_perms;

上面俩行是权限allow,可能会遇到权限还不够,具体增加方法看下面案列




●最后

有时候会遇到avc denied报错问题,这是因为安卓4.4(好像)以后增加了SELINUX权限问题

<7>[11281.586780] avc: denied { read write } for pid=1217 comm="mediaserver" name="tfa9897"

dev="tmpfs" ino=4385 scontext=u:r:mediaserver:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=0

allow mediaserver tfa9897_device:chr_file { open read write };

ino=4385 scontext=u:r:aa:s0 tcontext=u:bb_r:device:s0 tclass=ccc permissive=0

allow aa bb ccc { dd };







标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!