init.c解析service
来源:互联网 发布:linux文件服务器有哪些 编辑:程序博客网 时间:2024/05/19 20:48
对 service 关键字开头的内容进行解析
static void *parse_service(str t parse_state *state, int nargs, char **args)
{
str t service *svc;
if (nargs name = args[1];
svc->classname = “default”;
memcpy(svc->args, args + 2, sizeof(char*) * nargs);
svc->args[nargs] = 0;
svc->nargs = nargs;
svc->onrestart.name = “onrestart”;
list_init(&svc->onrestart.commands);
//添加该服务到 service_list 列表
list_add_tail(&service_list, &svc->slist);
return svc;
}
服务的表现形式:
service [ ]*
…
申 请一个service结构体,然后挂接到service_list链表上,name 为服务的名称 pathname 为执行的命令 argument 为命令的参数。之后的 option 用来控制这个service结构体的属性,parse_line_service 会对 service关键字后的 内容进行解析并填充到 service 结构中 ,当遇到下一个service或者on关键字的时候此service选项解析结束。
例如:
service zygote /system/bin/app_process -Xzygote /system/bin –zygote –start-system-server
socket zygote stream 666
onrestart write /sys/android_power/req st_state wake
服务名称为: zygote
启动该服务执行的命令: /system/bin/app_process
命令的参数: -Xzygote /system/bin –zygote –start-system-server
socket zygote stream 666: 创建一个名为:/dev/socket/zygote 的 socket ,类型为:stream
- init.c解析service
- init.c 解析 哪些rc
- Android启动流程分析(九) 解析init.rc的service
- init,runlevel和service
- android init中的service
- android init中的service
- android init中的service
- android init中的service
- init-service.action
- android init.c init.rc
- system/core/init/init.c
- android init.rc中的service
- init.rc中的service 问题
- android init.rc 的 service
- Android init.rc解析
- Android init.rc解析
- Android init.rc解析
- Android init.rc解析
- C# Preprocessor Directives - #If & # endif
- 开发的几条想法
- 简单工厂-简单计算器(仿照《大话设计模式》中示例)
- 我的笔
- 最大(小)堆的实现
- init.c解析service
- The IE/Win Disappearing List-Background Bug
- 【完美支持iOS5】iFile 1.6.1 含依赖包deb下载
- C# System.Reflection (反射)
- Java实现的简单电话号码储存
- C# System.Attribute (中括号)
- Fedora 16启动ssh服务
- android 学习一 android开发环境搭建
- struts2.1.6 action 02