简体   繁体   English

无法在Andorid的init.rc文件中看到运行服务/脚本

[英]Unable to see run service/ script in init.rc file in Andorid

init.rc init.rc

service Test /system/bin/sh /vendor/bin/Test.sh
class main
oneshot

on late-init start Test 在init-init开始测试

test.sh works well in terminal. test.sh在终端中运行良好。 It is intedned to create some directories eg mkdir in addition some print messages 它被用于创建一些目录,例如mkdir以及一些打印消息

But Service Test does not work at boot. 但服务测试在启动时不起作用。

I am adb pushing init rc and rebooting 我是adb push init rc并重新启动

I want to know is it really needed to build complete SW for this init.rc change. 我想知道是否真的需要为此init.rc更改构建完整的SW。

I do not see any error any log wrto my added part; 我添加的部分没有看到任何记录错误; however it is visible in rc file even after systen reboot. 但是即使在系统重启后它也在rc文件中可见。

I did following: 我做了以下事情:

  1. Used cpp file and with Andorid.bp created a IP.bin file in /system/bin 使用的cpp文件和Andorid.bp在/ system / bin中创建了一个IP.bin文件
  2. In Vendor/etc/init/ created a separate Init_IP.rc, which would run service ( execute .bin) after boot complete. 在Vendor / etc / init /中创建了一个单独的Init_IP.rc,它将在引导完成后运行service(execute .bin)。

This solved all of my problem. 这解决了我所有的问题。 "IP" commands not worked earlier since they are non-Toybox and part of /system/bin/, with .bin located in /system/bin/ have same SE state to make them work. “IP”命令之前没有工作,因为它们是非Toybox和/ system / bin /的一部分,位于/ system / bin /中的.bin具有相同的SE状态以使它们工作。

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

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