Lines Matching refs:is
11 when it is the last character on a line, may be used for line-folding.
16 `${property.name}`. This also works in contexts where concatenation is
23 Services have unique names. If a second Service is defined
24 with the same name as an existing one, it is ignored and an error
25 message is logged.
30 The init language is used in plain text files that take the .rc file
34 /init.rc is the primary .rc file and is loaded by the init executable
35 at the beginning of its execution. It is responsible for the initial
40 the primary /init.rc. This is explained in more details in the
44 able to import init scripts during mount_all, however that is deprecated
47 The intention of these directories is:
49 1. /system/etc/init/ is for core system items such as
51 2. /vendor/etc/init/ is for SoC vendor items such as actions or
53 3. /odm/etc/init/ is for device manufacturer items such as
60 directory of the partition where they reside. There is a build
65 An example is the userdebug logcatd.rc and Android.mk files located in the
72 This break up of init .rc files according to their daemon is preferred
84 is used to determine when the action is executed. When an event
85 occurs which matches an action's trigger, that action is added to
86 the tail of a to-be-executed queue (unless it is already on the
89 Each action in the queue is dequeued in sequence and each command in
90 that action is executed in sequence. Init handles other activities
157 is in the class "default" if one is not specified via the
163 of shutdown, access to /data partition is not guaranteed. These
165 and should work when /data is not available.
173 This option connects stdin, stdout, and stderr to the console. It is mutually exclusive with the
177 > This is a device-critical service. If it exits more than four times in
201 name must be a fully-qualified name and not a value name. For instance, this is used to allow
204 interface is `interface vendor.foo.bar@1.0::IBaz default`. For an AIDL interface, use
205 `interface aidl <instance name>`. The instance name for an AIDL interface is
206 whatever is registered with servicemanager, and these can be listed with `adb
215 keycodes are pressed at once, the service will start. This is typically used to start the
218 > This option may take a property instead of a list of keycodes. In this case, only one option is
229 bytes and `limit_percent` which is interpreted as a percentage of the size
230 of the device's physical memory (only if memcg is mounted).
235 (only if memcg is mounted). This property will override the values specified
239 > Sets the child's memory.soft_limit_in_bytes to the specified value (only if memcg is mounted),
243 > Sets the child's memory.swappiness to the specified value (only if memcg is mounted),
260 > Indicates that this service definition is meant to override a previous definition for a service
261 with the same name. This is typically meant for services on /odm to override those defined on
262 /vendor. The last service definition that init parses with this keyword is the service definition
269 -20 to 19. Default priority is 0. Priority is set via setpriority().
274 _target_. _target_ takes the same format as the parameter to sys.powerctl. This is particularly
288 It is parsed similarly to the setrlimit command specified below.
295 If not specified and no transition is defined in policy, defaults to the init context.
301 > Set shutdown behavior of the service process. When this is not specified,
302 the service is killed during shutdown process by using SIGTERM and SIGKILL.
303 The service with shutdown_behavior of "critical" is not killed during shutdown
306 is not running when shut down starts, it will be started.
309 > Send SIGSTOP to the service immediately before exec is called. This is intended for debugging.
316 group default to 0. 'seclabel' is the SELinux security context for the
322 > Redirect stdout and stderr to /dev/kmsg_debug. This is useful for services that do not use native
323 Android logging during early boot and whose logs messages we want to capture. This is only enabled
324 when /dev/kmsg_debug is enabled, which is only enabled on userdebug and eng builds.
325 This is mutually exclusive with the console option, which additionally connects stdin to the
329 > Set task profiles for the process when it forks. This is designed to replace the use of
333 > Provide a timeout after which point the service will be killed. The oneshot keyword is respected
335 This is particularly useful for creating a periodic service combined with the restart_period
340 the boot sequence by APEXes. When a service with updatable option is started
341 before APEXes are all activated, the execution is delayed until the activation
342 is finished. A service that is not marked as updatable cannot be overridden by
351 capabilities, then drop to its desired uid. There is a new
354 be used instead. This mechanism is described on
364 system property 'ro.cpuset.default' is set to a non-empty cpuset name (e.g.
365 '/foreground'), then the pid is written to file /dev/cpuset/_cpuset\_name_/tasks.
366 The use of this option for moving a process into a cgroup is obsolete. Please
392 `on boot && property:a=b` defines an action that is only executed when
395 `on property:a=b && property:c=d` defines an action that is executed
408 but bootcharting is only active if the file /data/bootchart/enabled exists;
448 Regarding to the dst file, the default mode created is 0600 if it does not
449 exist. And it will be truncated if dst file is a normal regular file and
458 If the service is supposed to be running, it will be started now.
474 > Fork and execute command with the given arguments. This is handled similarly
475 to the `exec` command. The difference is that init does not halt executing
486 started after this command is executed)
504 case it is specified as `<interface>/<instance>`, or an AIDL name, in which case it is specified as
519 > (This action is deprecated and no-op.)
523 This is included in the default init.rc.
533 > Used to mark the point right after /data is mounted. Used to implement the
538 group. If not provided, the directory is created with permissions 755 and
543 * `None`: take no encryption action; directory will be encrypted if parent is.
559 no option is set, and mount\_all will process all entries in the given fstab.
560 If the fstab parameter is not specified, fstab.${ro.boot.fstab_suffix},
577 > Stops and restarts a running service, does nothing if the service is currently
592 use "exec -- rm ..." instead (provided the system partition is
608 the limit is set. It is intended to be set early in init and applied globally.
609 _resource_ is best specified using its text representation ('cpu', 'rtio', etc
615 > Start a service running if it is not already running.
616 Note that this is _not_ synchronous, and even if it were, there is
624 services is _not_ sufficient to guarantee that the channel has
629 > Stop a service from running if it is currently running.
633 If the fstab parameter is not specified, fstab.${ro.boot.fstab_suffix},
652 If the fstab parameter is not specified, fstab.${ro.boot.fstab_suffix},
663 or the timeout has been reached. If timeout is not specified it
669 within _value_. If property _name_ is already set to _value_, continue
682 If _path_ is a directory, each file in the directory is parsed as
683 a config file. It is not recursive, nested directories will
686 The import keyword is not a command, but rather its own section,
688 imports are handled as a file is being parsed and follow the below logic.
700 The order that files are imported is a bit complex for legacy reasons
701 and to keep backwards compatibility. It is not strictly guaranteed.
704 different command is to either 1) place it in an Action with an
708 Nonetheless, the de facto order for first stage mount devices is:
709 1. /init.rc is parsed then recursively each of its imports are
712 sequentially, with imports happening recursively after each file is
714 3. Step 2 is repeated for /vendor/etc/init then /odm/etc/init
747 `ctl.[<target>_]<command>` and the _value_ of the system property is used as a parameter. The
748 _target_ is optional and specifies the service option that _value_ is meant to match with. There is
771 flag for the service specified by the _value_ of the property. This is
815 The log files are written to /data/bootchart/. A script is provided to
823 One thing to watch for is that the bootchart will show init as if it started
838 process: baseline experiment (delta) - Unit is ms (a jiffy is 10 ms on the system)
855 Here is an example of trace events of "wm" and "am" categories:
860 This command will cause the device to reboot. After the device is rebooted and
861 the boot sequence has finished, the trace report is obtained from the device
864 Limitation: recording trace events is started after persistent properties are loaded, so
874 When a service starts from init, it may fail to `execv()` the service. This is not typical, and may
875 point to an error happening in the linker as the new service is started. The linker in Android
876 prints its logs to `logd` and `stderr`, so they are visible in `logcat`. If the error is encountered
877 before it is possible to access `logcat`, the `stdio_to_kmsg` service option may be used to direct
880 Launching init services without init is not recommended as init sets up a significant amount of
881 environment (user, groups, security label, capabilities, etc) that is hard to replicate manually.
883 If it is required to debug a service from its very start, the `sigstop` service option is added.
889 Below is an example of dynamically debugging logd via the above:
903 Below is an example of doing the same but with strace
920 Init scripts are checked for correctness during build time. Specifically the below is checked.
924 2) All commands map to a valid keyword and the argument count is within the correct range.
925 3) All service options are valid. This is stricter than how commands are checked as the service
938 The early init boot sequence is broken up into three stages: first stage init, SELinux setup, and
941 First stage init is responsible for setting up the bare minimum requirements to load the rest of the
946 Note that in Android Q, system.img always contains TARGET_ROOT_OUT and always is mounted at / by the
952 1) For system-as-root devices, first stage init is part of /system/bin/init and a symlink at /init
954 mount system.img, since it is by definition already mounted as the rootfs by the kernel.
956 2) For devices with a ramdisk, first stage init is a static executable located at /init. These
964 into recovery mode is made if androidboot.force_normal_boot=1 is present in the
968 phase is where SELinux is optionally compiled and loaded onto the system. selinux.cpp contains more