init进程【3】——Init 脚本语言

欢迎转载,转载请注明:http://blog.csdn.net/zhgxhuaa


下面的内容来自于@system/core/init/readme.txt文件,这是关于rc脚本的完整的语法介绍:



The Android Init Language consists of four broad classes of statements,
which are Actions, Commands, Services, and Options.


All of these are line-oriented, consisting of tokens separated by
whitespace.  The c-style backslash escapes may be used to insert
whitespace into a token.  Double quotes may also be used to prevent
whitespace from breaking text into multiple tokens.  The backslash,
when it is the last character on a line, may be used for line-folding.


Lines which start with a # (leading whitespace allowed) are comments.


Actions and Services implicitly declare a new section.  All commands
or options belong to the section most recently declared.  Commands
or options before the first section are ignored.


Actions and Services have unique names.  If a second Action or Service
is declared with the same name as an existing one, it is ignored as
an error.  (??? should we override instead)




Actions
-------
Actions are named sequences of commands.  Actions have a trigger which
is used to determine when the action should occur.  When an event
occurs which matches an action's trigger, that action is added to
the tail of a to-be-executed queue (unless it is already on the
queue).


Each action in the queue is dequeued in sequence and each command in
that action is executed in sequence.  Init handles other activities
(device creation/destruction, property setting, process restarting)
"between" the execution of the commands in activities.


Actions take the form of:


on <trigger>
   <command>
   <command>
   <command>




Services
--------
Services are programs which init launches and (optionally) restarts
when they exit.  Services take the form of:


service <name> <pathname> [ <argument> ]*
   <option>
   <option>
   ...




Options
-------
Options are modifiers to services.  They affect how and when init
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值