简体   繁体   English

Selinux拒绝在Android 8上启动服务

[英]Selinux Denies Starting Service on Android 8

Recently I am working on Android 8 and blocked with selinux issue… 最近,我正在使用Android 8,并因selinux问题而被阻止…

I create a “ppp” service in init.rc to start pppd as below: 我在init.rc中创建一个“ ppp”服务以启动pppd,如下所示:

service ppp /system/bin/pppd call gprs
user root
group system radio
disabled
oneshot

But it failed when starting this service with command “setprop ctl.start ppp”. 但是使用命令“ setprop ctl.start ppp”启动此服务时失败。

The selinux is already set to permissive mode but still shows as follows, and service is not started: selinux已经设置为许可模式,但仍显示如下,并且服务未启动:

console:/ # [ 430.567622] init: Could not ctl.start for service ppp: File /system/bin/pppd(labeled "u:object_r:ppp_exec:s0") has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. 控制台:/#[430.567622]初始化:无法为服务ppp ctl.start:文件/ system / bin / pppd(标记为“ u:object_r:ppp_exec:s0”)标签不正确,或者没有从u:r:init进行域转换:s0到另一个定义的SELinux域。 Have you configured your service correctly? 您是否正确配置了服务? https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials

The ppp.te and file_contexts is not changed: ppp.te和file_contexts不会更改:

ppp.te: ppp.te:

typeattribute ppp coredomain;

domain_auto_trans(mtp, ppp_exec, ppp)

file_contexts: file_contexts:

/system/bin/pppd    u:object_r:ppp_exec:s0

Any information to solve this problem is appreciated, thanks in advance! 感谢您提供任何解决该问题的信息,谢谢!

When you use “setprop ctl.start ppp”, the service is started from init. 当您使用“ setprop ctl.start ppp”时,该服务从init启动。

Try with this policy: 尝试以下政策:

domain_auto_trans(init, ppp_exec, ppp)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM