android5.02上init.rc中的service就是启动不了.
我在init.rc中有这么一个service
目的是执行一个sh文件.
service qtnrfon /system/bin/sh /system/bin/qtn-rfenable.sh 1
class main
user system
group system
seclabel u:r:shell:s0 //这句是后来加上的,加不加都一样.
oneshot
然后在命令行下通过setprop ctl.start qtnrfon来启动,发现启动不了.
在init.c中的service_start()函数中打印的log如下:
说找不到这个文件,但是这个文件明明就在system/bin里面放着啊.我手动去source 这个文件也能执行成功.
<11>[ 272.083916] init: ADL args[0] = /system/bin/qtn-rfenable.sh
<11>[ 272.083918] init: ADL arg_ptrs[0] = /system/bin/qtn-rfenable.sh
<11>[ 272.083920] init: ADL ENV[0] = force_s3tc_enable=true
<11>[ 272.083922] init: ADL ENV[1] = PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
<11>[ 272.083982] init: cannot execve('/system/bin/qtn-rfenable.sh'): No such file or directory
<11>[ 272.083986] init: cannot execve('/system/bin/qtn-rfenable.sh'): error = 2