Enters the namespace of type type located at path. Note that only one namespace of a given type may be entered. Open a file path and pass its fd to the launched process. Additional groupnames beyond the required first one are used to set the supplemental groups of the process via setgroups.
Currently defaults to root. The interface name must be a fully-qualified name and not a value name. For instance, this is used to allow servicemanager or hwservicemanager to lazily start services. When multiple interfaces are served, this tag should be used multiple times.
An example of an entry for a HIDL interface is interface vendor. The instance name for an AIDL interface is whatever is registered with servicemanager, and these can be listed with adb shell dumpsys -l. Sets the keycodes that will trigger this service.
If all of the keys corresponding to the passed keycodes are pressed at once, the service will start. This is typically used to start the bugreport service. This option may take a property instead of a list of keycodes. In this case, only one option is provided: the property name in the typical property expansion format.
Values must be equal or greater than 0. Sets the child's memory. This property will override the values specified via memcg. Indicates that this service definition is meant to override a previous definition for a service with the same name.
The last service definition that init parses with this keyword is the service definition will use for this service. Pay close attention to the order in which init. Scheduling priority of the service process. This value has to be in range to Default priority is 0. Priority is set via setpriority.
If a non-oneshot service exits, it will be restarted at its start time plus this period. It defaults to 5s to rate limit crashing services. This can be increased for services that are meant to run periodically.
For example, it may be set to to indicate that the service should run every hour or to indicate that the service should run every day. This applies the given rlimit to the service. It is parsed similarly to the setrlimit command specified below. Primarily for use by services run from the rootfs, e. Services on the system partition can instead use policy-defined transitions based on their file security context. If not specified and no transition is defined in policy, defaults to the init context.
Set shutdown behavior of the service process. This is intended for debugging. See the below section on debugging for how this can be used. User and group default to 0. It defaults to the service security context, as specified by seclabel or computed based on the service executable file security context.
This is useful for services that do not use native Android logging during early boot and whose logs messages we want to capture. This is mutually exclusive with the console option, which additionally connects stdin to the given console. Set task profiles for the process when it forks.
This is designed to replace the use of writepid option for moving a process into a cgroup. Provide a timeout after which point the service will be killed. The oneshot keyword is respected here, so oneshot services do not automatically restart, however all other services will.
When a service with updatable option is started before APEXes are all activated, the execution is delayed until the activation is finished. A service that is not marked as updatable cannot be overridden by APEXes. Previously, to acquire Linux capabilities, a process would need to run as root, request the capabilities, then drop to its desired uid.
When using this new mechanism, processes can use the user option to select their desired uid without ever running as root. As of Android O, processes can also request capabilities directly in their. Write the child's pid to the given files when it forks. The use of this option for moving a process into a cgroup is obsolete.
Triggers are strings which can be used to match certain kinds of events and used to cause an action to occur. Property triggers are strings triggered when a named property changes value to a given new value or when a named property changes value to any new value.
Property triggers are additionally evaluated and triggered accordingly during the initial boot phase of init. Init uses the following sequence of triggers during early boot. These are the built-in triggers defined in init. Remaining triggers are configured in init. Actions internal to init. These are present in the default init.
Start all services of the specified class if they are not already running. Services take the form of:. This service needs a console. The optional second parameter chooses a specific console instead of the default. This is a device-critical service. If it exits more than four times in four minutes, the device will reboot into recovery mode. This service will not automatically start with its class. It must be explicitly started by name. User and group default to 0.
It defaults to the service security context, as specified by seclabel or computed based on the service executable file security context. Open a file path and pass its fd to the launched process. Currently defaults to root. Previously, to acquire Linux capabilities, a process would need to run as root, request the capabilities, then drop to its desired uid.
When using this new mechanism, processes can use the user option to select their desired uid without ever running as root. As of Android O, processes can also request capabilities directly in their.
Additional groupnames beyond the required first one are used to set the supplemental groups of the process via setgroups. Primarily for use by services run from the rootfs, e. Services on the system partition can instead use policy-defined transitions based on their file security context. If not specified and no transition is defined in policy, defaults to the init context. Specify class names for the service.
All services in a named class may be started or stopped together. Additional classnames beyond the required first one are used to group services. Scheduling priority of the service process. This value has to be in range to Default priority is 0. Priority is set via setpriority. Set shutdown behavior of the service process. Triggers are strings which can be used to match certain kinds of events and used to cause an action to occur. Property triggers are strings triggered when a named property changes value to a given new value or when a named property changes value to any new value.
Property triggers are additionally evaluated and triggered accordingly during the initial boot phase of init. These are present in the default init. Recovery after Linux misoperation Getting started with spring security 1. Introduction to spring security 3.
Introduction to spring security 2. Getting started with spring security 4. Deploy Maven private server. Git pit entry. Spring security pit entry III. Spring security pit entry II. Spring security pit entry V. Linux summary. Ultimate Guide to website front end performance optimization. Android development studio beginner tutorial. When the conditions are met, the script will be executed. There are some commands in the script, and different scripts are distinguished by on.
Trigger is the trigger we mentioned above, which is essentially a string that can match a certain event containing the string. Triggers are subdivided into event triggers and property triggers. Triggers triggers is a string used to match specific event types to make Actions happen. An Action can have multiple attribute triggers, but there is at most one event trigger. Let's look at two examples below:. This Action will only be triggered when the boot event occurs and the attributes a and b are equal.
A service is a program that starts with service and is started by the init process. Generally, it runs in another child process of init. Therefore, it is necessary to determine whether the corresponding executable file exists before starting the service. The sub-processes generated by init are defined in the rc file, and each service in it will generate sub-processes through the fork method at startup.
The form of Services is as follows:. In order to facilitate understanding, I put the whole init. Next, we analyze the execution process of the following main function in detail; it may be relatively long, so please take a look:. Dmytro - Sep Iman Dolatkia - Sep DEV Community is a community of , amazing developers We're a place where coders share, stay up-to-date and grow their careers.
Create account Log in. Twitter Facebook Github Instagram Twitch. Actions Actions are the start of a series of commands Actions represent some Actions.
0コメント