在服务激的Andr​​oid init.rc触发 [英] Android init.rc trigger on service-exited

查看:234
本文介绍了在服务激的Andr​​oid init.rc触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够从Android中的启动脚本(init.rc)开始自己的服务,继发现导游:的 http://www.androidenea.com/2009/08/init-process-and-initrc.html 或与<找到的官方文档HREF =htt​​p://android.git.kernel.org/?p=platform/system/core.git;a=blob;f=init/readme.txt;hb=HEAD rel=\"nofollow\">http://android.git.kernel.org/?p=platform/system/core.git;a=blob;f=init/readme.txt;hb=HEAD

I was able to start my own services from the init script (init.rc) in Android, following the guides found at: http://www.androidenea.com/2009/08/init-process-and-initrc.html or with the official documentation found at http://android.git.kernel.org/?p=platform/system/core.git;a=blob;f=init/readme.txt;hb=HEAD

有一个名为触发关于服务×[出口&LT; 名称>,其中的名称的是具有这样的动作之前退出服务的名称触发执行。
然而,这触发似乎并没有工作。我开始了一个小的shell脚本作为一种服务,并创建相应的触发启动后所有剩余的服务。 init进程似乎我的脚本执行之后被卡住,并且不与其余服务继续。

There is a trigger called "on service-exit-<name>" where name is the name of the service which has to exit before the actions of this trigger are executed. However, this trigger does not seem to work. I started a small shell script as a service and created the trigger accordingly to start all remaining services afterwards. The init process seems to be stuck after the execution of my script and does not continue with the remaining services.

的最终目标是实现像一个控制或'上演'引导过程中,在那里我可以确保该脚本首先被执行,然后remainnig服务启动。我也试图实现与使用不同的服务等级,但未能

The final goal would be to achieve something like a controlled or 'staged' boot process, where I can make sure that this script is executed first and then the remainnig services are started. I also tried to accomplish that with using different service classes but failed

在这个问题上的任何帮助AP preciated。

Any help on that subject is appreciated.

推荐答案

阅读我发现,初始化设置属性(init.svc&LT;名称&gt;)来源为停止,当一个服务退出。这意味着你可以使用属性触发器来实现什么样的服务-×[出口&LT;名称&gt;应该做的:

reading the sources i found that init sets a property (init.svc.<name>) to "stopped" when a service exits. this means you can use property triggers to achieve what service-exit-<name> is supposed to do:

service 2nd_svc /system/bin/2nd_svc
    oneshot
    disabled

on property:init.svc.1st_svc=stopped
    start 2nd_svc

这篇关于在服务激的Andr​​oid init.rc触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆