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文件,并在其中添加如下内容:

需要为新增的进程增加域、执行权限

type xxx, domain;

type xxx_exec, exec_type, file_type;

然后启用这个域

init_daemon_domain(xxx)

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权限问题

权限增加规则如下:

案列1)

<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  device chr_file { open read write };

案列2)

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

ino=4385 scontext=u:r:aa:s0 tcontext=u:object_r:bb:s0 tclass=ccc permissive=0

allow aa bb ccc { dd };

Service xxx does not have a SELinux domain defined.amp;amp;avc denied权限问题相关推荐

  1. Service xxx does not have a SELinux domain defined

    点击打开链接 为了完成公司项目的一个需求,需要添加一个binder服务xxx,并且设置成开机自启动.于是我在init.rc中添加了如下代码行: service xxx /system/bin/xxxc ...

  2. init: Service powerbtn does not have a SELinux domain defined.

    https://www.brobwind.com/archives/291 Brillo: 编译运行example-ledflasher程序 2016-01-05 22:01:40 ~ 2016-01 ...

  3. 【Android O】 Service AAA does not have a SELinux domain defined

    在init.AAA.rc里面添加了一个脚本启动的服务: service AAA /vendor/bin/sh /vendor/etc/AAA_spec.sh user root group root ...

  4. Service rootservice does not have a SELinux domain defined

    新增一个SELINUX启动的时候出现问题 新增如下 service rootservice /system/bin/rootserviceuser rootgroup rootdisabledones ...

  5. CentOS使用chkconfig增加开机服务提示service xxx does not support chkconfig的问题解决

    CentOS使用chkconfig增加开机服务提示service xxx does not support chkconfig的问题解决 参考文章: (1)CentOS使用chkconfig增加开机服 ...

  6. Linux下service xxx start/stop/restart启动服务、关闭服务、重启服务深入理解@

    我们经常使用service xxx start来启动一个服务,那么service究竟是执行的是什么? 实际上service是一个/sbin/下的一个脚本,名称为service.服务的绝对路径为/sbi ...

  7. Dubbo3注册为应用级时报错“No provider available for the service XXX”

    文章目录 Dubbo3注册模式介绍 踩坑记录 Dubbo3注册为应用级时,Nacos注册中心看到注册服务服务和订阅列表均正常,但是实际调用时报错"No provider available ...

  8. The final local variable xxx cannot be assigned, since it is defined in an enclo

     本文就自己编程时候遇到的一个问题,简要描述一下,并提出解决的方法: 出错信息:The final local variable xxx cannot be assigned, since it is ...

  9. [Linux] xxx/rhel7/repodata/repomd.xml: [Errno 14] FTP Error 550 - Server denied you to XXX

    自定义的第三方软件源目录中出现该错误 在学习ftp文件传输时,想要使用yum下载镜像中的工具lftp,出现错误:xxx/rhel7/repodata/repomd.xml: [Errno 14] FT ...

最新文章

  1. img 在video上面_HTML,img,video无法铺满屏幕解决方法,同视频做网页背景无法全屏的解决方法...
  2. 多模态任务新蓝海:视觉语言导航最新进展
  3. 作者:李超(1988-),男,上海交通大学硕士生,主要研究方向为大数据网络。...
  4. pytorch 入门学习 实现线性回归-5
  5. Win10 UWP系列:关于错误 0x80073CF9及一个小bug的解决
  6. 【数据结构】二分查找代码模板
  7. ARM体系结构的特点
  8. 基于SSM的旅游管理系统
  9. 【深度学习之美笔记】人工“碳”索意犹尽,智能“硅”来未可知(入门系列之二)
  10. 基因结构图的0_在线网站绘制基因结构图!
  11. TCP协议格式和特点
  12. 一份来自前端开发工程师的规范简历
  13. 浅谈辅助功能 AccessibilityService
  14. 关于地图开发的那些坑儿
  15. ie8 阻止java运行_解决IE屏蔽Java Applet问题的方法
  16. DeDeCMS v5.7 SP2 前台任意用户密码修改漏洞复现
  17. [转载]HEVC的快速模式选择(一)
  18. 彩色星球科技旗下元宇宙平台“彩色世界”亚洲版即将发布;Branch宣布获得3亿美元融资 | 全球TMT...
  19. erp中的:ATP、CTP、APS的概念
  20. atm机是专用计算机吗,计算机网络中的ATM技术和ATM自动取款机的ATM意思一样吗

热门文章

  1. 5. live555 bind error
  2. CM/CDH 问题记录
  3. 5、小型企业无线网部署(案例1)从客户需求来分析、规划、部署
  4. 《创始人》读书笔记(一)
  5. WPS 2019好用吗?
  6. 新版支付宝手机网站支付、支付宝pc支付、支付宝无密退款实现
  7. 普中tft彩屏驱动程序下载_基于51单片机的2.0-R61503B 8bits TFT彩屏刷屏触摸驱动程序...
  8. 【Proteus仿真】【STM32单片机】玩转TFTLCD彩屏设计
  9. java什么是双亲委派,为什么它可以保证安全?
  10. 国产软件浩辰CAD从“芯”出发,推动企业科技创新发展