设为首页 加入收藏

TOP

Android启动脚本init.rc(二)
2014-11-24 03:29:32 来源: 作者: 【 】 浏览:1
Tags:Android 启动 脚本 init.rc
started by name.


setenv
Set the environment variable to in the launched process.


socket [ [ ] ]
Create a unix domain socket named /dev/socket/ and pass
its fd to the launched process. must be "dgram" or "stream".
User and group default to 0.


user
Change to username before exec'ing this service.
Currently defaults to root. ( probably should default to nobody)
Currently, if your process requires linux capabilities then you cannot use
this command. You must instead request the capabilities in-process while
still root, and then drop to your desired uid.


group [ ]*
Change to groupname before exec'ing this service. Additional
groupnames beyond the (required) first one are used to set the
supplemental groups of the process (via setgroups()).
Currently defaults to root. ( probably should default to nobody)


oneshot
Do not restart the service when it exits.


class
Specify a class name for the service. All services in a
named class may be started or stopped together. A service
is in the class "default" if one is not specified via the
class option.


onrestart
Execute a Command (see below) when service restarts.


Triggers
--------
Triggers are strings which can be used to match certain kinds
of events and used to cause an action to occur.


boot
This is the first trigger that will occur when init starts
(after /init.conf is loaded)


=
Triggers of this form occur when the property is set
to the specific value .


device-added-
device-removed-
Triggers of these forms occur when a device node is added
or removed.


service-exited-
Triggers of this form occur when the specified service exits.



Commands
--------


exec [ ]*
Fork and execute a program (). This will block until
the program completes execution. It is best to avoid exec
as unlike the builtin commands, it runs the risk of getting
init "stuck". ( maybe there should be a timeout )


export
Set the environment variable equal to in the
global environment (which will be inherited by all processes
started after this command is executed)


ifup
Bring the network interface online.


import
Parse an init config file, extending the current configuration.


hostname
Set the host name.


chdir
Change working directory.


chmod
Change file access permissions.


chown
Change file owner and group.


chroot
Change process root directory.


class_start
Start all services of the specified class if they are
not already running.


class_stop
Stop all services of the specified class if they are
currently running.


domainname
Set the domain name.


insmod
Install the module at


mkdir [mode] [owner] [group]
Create a directory at , optionally with the given mode, owner, and
group. If not provided, the directory is created with permissions 755 and
owned by the root user and root group.


mount

[ ]*
Attempt to mount the named device at the directory

may be of the form mtd@name to specify a mtd block
device by name.
s include "ro", "rw", "remount", "noatime", ...


setkey
TBD


setprop
Set system property to .


setrlimit
Set the rlimit for a resource.


start
Start a service running if it is not already running.


stop
Stop a service from running if it is currently running.


symlink
Create a symbolic link at with the value


sysclktz
Set the system clock base (0 if system clock ticks in GMT)


trigger
Trigger an event. Used to queue an action from another
action.


write [ ]*
Open the file at and write one or more strings
to it with write(2)



Properties
----------
Init updates some system properties to provide som

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇为Android内核添加新驱动并添加到.. 下一篇Linux内核通用链表 <linux/lis..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·工业机器人TCP校准中 (2025-12-25 05:19:17)
·opc 通讯协议与 TCP (2025-12-25 05:19:15)
·labview中tcp/ip通信 (2025-12-25 05:19:13)
·新书介绍《Python数 (2025-12-25 04:49:47)
·怎么利用 Python 进 (2025-12-25 04:49:45)