From 57c3246511434f42214e113b8902af10ab9cca49 Mon Sep 17 00:00:00 2001 From: xsipewe Date: Tue, 21 Jun 2016 15:50:34 +0200 Subject: erts: Editorial changes --- erts/doc/src/init.xml | 226 ++++++++++++++++++++++++++++---------------------- 1 file changed, 125 insertions(+), 101 deletions(-) (limited to 'erts/doc/src/init.xml') diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index a88a815ef6..54507c6572 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - + init @@ -30,128 +30,140 @@ init.xml init - Coordination of System Startup + Coordination of system startup. -

The init module is pre-loaded and contains the code for - the init system process which coordinates the start-up of - the system. The first function evaluated at start-up is - boot(BootArgs), where BootArgs is a list of command - line arguments supplied to the Erlang runtime system from - the local operating system. See - erl(1).

-

init reads the boot script which contains instructions on - how to initiate the system. See - script(4) for more - information about boot scripts.

+

This module is preloaded and contains the code for + the init system process that coordinates the startup of + the system. The first function evaluated at startup is + boot(BootArgs), where BootArgs is a list of + command-line arguments supplied to the Erlang runtime system from + the local operating system; see + erl(1).

+ +

init reads the boot script, which contains instructions on + how to initiate the system. For more information about boot scripts, see + sasl:script(4).

+

init also contains functions to restart, reboot, and stop the system.

+ - Start the Erlang runtime system + Start the Erlang runtime system.

Starts the Erlang runtime system. This function is called - when the emulator is started and coordinates system start-up.

-

BootArgs are all command line arguments except - the emulator flags, that is, flags and plain arguments. See - erl(1).

-

init itself interprets some of the flags, see - Command Line Flags below. + when the emulator is started and coordinates system startup.

+

BootArgs are all command-line arguments except + the emulator flags, that is, flags and plain arguments; see + erl(1).

+

init interprets some of the flags, see section + Command-Line Flags below. The remaining flags ("user flags") and plain arguments are passed to the init loop and can be retrieved by calling - get_arguments/0 and get_plain_arguments/0, - respectively.

+ get_arguments/0 + and + get_plain_arguments/0, respectively.

+ - Get the values associated with a command line user flag + Get the values associated with a command-line user flag. + -

Returns all values associated with the command line user flag - Flag. If Flag is provided several times, each - Values is returned in preserved order.

+

Returns all values associated with the command-line user flag + Flag. If Flag is provided + several times, each Values is returned in + preserved order. Example:

 % erl -a b c -a d
 ...
 1> init:get_argument(a).
 {ok,[["b","c"],["d"]]}
-

There are also a number of flags, which are defined +

The following flags are defined automatically and can be retrieved using this function:

root -

The installation directory of Erlang/OTP, $ROOT.

+

The installation directory of Erlang/OTP, $ROOT:

 2> init:get_argument(root).
 {ok,[["/usr/local/otp/releases/otp_beam_solaris8_r10b_patched"]]}
progname -

The name of the program which started Erlang.

+

The name of the program which started Erlang:

 3> init:get_argument(progname).
 {ok,[["erl"]]}
home -

The home directory.

+

The home directory:

 4> init:get_argument(home).
 {ok,[["/home/harry"]]}
-

Returns error if there is no value associated with - Flag.

+

Returns error if no value is associated with Flag.

+ - Get all command line user flags + Get all command-line user flags. -

Returns all command line flags, as well as the system - defined flags, see get_argument/1.

+

Returns all command-line flags and the system-defined flags, see + get_argument/1.

+ - Get all non-flag command line arguments + Get all non-flag command-line arguments. -

Returns any plain command line arguments as a list of strings +

Returns any plain command-line arguments as a list of strings (possibly empty).

+ - Get system status information + Get system status information.

The current status of the init process can be inspected. During system startup (initialization), InternalStatus is starting, and - ProvidedStatus indicates how far the boot script has - been interpreted. Each {progress, Info} term - interpreted in the boot script affects ProvidedStatus, - that is, ProvidedStatus gets the value of Info.

+ ProvidedStatus indicates how far the boot + script has been interpreted. Each {progress, Info} term + interpreted in the boot script affects + ProvidedStatus, that is, + ProvidedStatus gets the value of Info.

+ - Take down and restart an Erlang node smoothly + Take down and restart an Erlang node smoothly.

All applications are taken down smoothly, all code is unloaded, and all ports are closed before the system - terminates. If the -heart command line flag was given, - the heart program will try to reboot the system. Refer - to heart(3) for more information.

+ terminates. If command-line flag -heart was specified, + the heart program tries to reboot the system. For more + information, see + kernel:heart(3).

To limit the shutdown time, the time init is allowed - to spend taking down applications, the -shutdown_time - command line flag should be used.

+ to spend taking down applications, command-line flag + -shutdown_time is to be used.

+ - Restart the running Erlang node + Restart the running Erlang node.

The system is restarted inside the running Erlang node, which means that the emulator is not restarted. All @@ -160,80 +172,91 @@ the same way as initially started. The same BootArgs are used again.

To limit the shutdown time, the time init is allowed - to spend taking down applications, the -shutdown_time - command line flag should be used.

+ to spend taking down applications, command-line flag + -shutdown_time is to be used.

+ - Get the identity of the used boot script + Get the identity of the used boot script. -

Get the identity of the boot script used to boot the system. +

Gets the identity of the boot script used to boot the system. Id can be any Erlang term. In the delivered boot - scripts, Id is {Name, Vsn}. Name and - Vsn are strings.

+ scripts, Id is {Name, Vsn}. Name + and Vsn are strings.

+ - Take down an Erlang node smoothly + Take down an Erlang node smoothly.

The same as stop(0).

+ - Take down an Erlang node smoothly + Take down an Erlang node smoothly.

All applications are taken down smoothly, all code is unloaded, and all ports are closed before the system - terminates by calling halt(Status). If the - -heart command line flag was given, the heart - program is terminated before the Erlang node - terminates. Refer to heart(3) for more - information.

+ terminates by calling halt(Status). If + command-line flag -heart was specified, the heart + program is terminated before the Erlang node terminates. + For more information, see + kernel:heart(3).

To limit the shutdown time, the time init is allowed - to spend taking down applications, the -shutdown_time - command line flag should be used.

+ to spend taking down applications, command-line flag + -shutdown_time is to be used.

- Command Line Flags -

The support for loading of code from archive files is - experimental. The sole purpose of releasing it before it is ready - is to obtain early feedback. The file format, semantics, - interfaces etc. may be changed in a future release. The - -code_path_choice flag is also experimental.

+ Command-Line Flags + +

The support for loading of code from archive files is + experimental. The only purpose of releasing it before it is ready + is to obtain early feedback. The file format, semantics, + interfaces, and so on, can be changed in a future release. The + -code_path_choice flag is also experimental.

+
-

The init module interprets the following command line - flags:

+

The init module interprets the following command-line flags:

--

Everything following -- up to the next flag is considered plain arguments and can be retrieved using - get_plain_arguments/0.

+ + get_plain_arguments/0.

-code_path_choice Choice -

This flag can be set to strict or relaxed. It - controls whether each directory in the code path should be - interpreted strictly as it appears in the boot script or if - init should be more relaxed and try to find a suitable - directory if it can choose from a regular ebin directory and - an ebin directory in an archive file. This flag is particular - useful when you want to elaborate with code loading from - archives without editing the boot script. See script(4) for more information - about interpretation of boot scripts. The flag does also have - a similar affect on how the code server works. See code(3).

- +

Can be set to strict or relaxed. It controls how each + directory in the code path is to be interpreted:

+ + +

Strictly as it appears in the boot script, or

+
+ +

init is to be more relaxed and try to find a suitable + directory if it can choose from a regular ebin directory + and an ebin directory in an archive file.

+
+
+

This flag is particular + useful when you want to elaborate with code loading from + archives without editing the boot script. For more + information about interpretation of boot scripts, see + sasl:script(4). + The flag has also a similar effect on how the code server works; see + kernel:code(3).

-epmd_module Module @@ -242,11 +265,11 @@ -eval Expr -

Scans, parses and evaluates an arbitrary expression +

Scans, parses, and evaluates an arbitrary expression Expr during system initialization. If any of these - steps fail (syntax error, parse error or exception during - evaluation), Erlang stops with an error message. Here is an - example that uses Erlang as a hexadecimal calculator:

+ steps fail (syntax error, parse error, or exception during + evaluation), Erlang stops with an error message. In the following + example Erlang is used as a hexadecimal calculator:

 % erl -noshell -eval 'R = 16#1F+16#A0, io:format("~.16B~n", [R])' \\
 -s erlang halt
@@ -256,14 +279,15 @@ BF
-eval expressions are evaluated sequentially with -s and -run function calls (this also in the order specified). As with -s and -run, an - evaluation that does not terminate, blocks the system + evaluation that does not terminate blocks the system initialization process.

-extra

Everything following -extra is considered plain arguments and can be retrieved using - get_plain_arguments/0.

+ + get_plain_arguments/0.

-run Mod [Func [Arg1, Arg2, ...]] @@ -285,8 +309,8 @@ foo:bar() foo:bar(["baz", "1", "2"]).

The functions are executed sequentially in an initialization process, which then terminates normally and passes control to - the user. This means that a -run call which does not - return will block further processing; to avoid this, use + the user. This means that a -run call that does not + return blocks further processing; to avoid this, use some variant of spawn in such cases.

-s Mod [Func [Arg1, Arg2, ...]] @@ -309,11 +333,11 @@ foo:bar() foo:bar([baz, '1', '2']).

The functions are executed sequentially in an initialization process, which then terminates normally and passes control to - the user. This means that a -s call which does not - return will block further processing; to avoid this, use + the user. This means that a -s call that does not + return blocks further processing; to avoid this, use some variant of spawn in such cases.

-

Due to the limited length of atoms, it is recommended that - -run be used instead.

+

Because of the limited length of atoms, it is recommended to + use -run instead.

@@ -335,9 +359,9 @@ error
- SEE ALSO -

erl_prim_loader(3), - heart(3)

+ See Also +

erl_prim_loader(3), + kernel:heart(3)

-- cgit v1.2.3