From dfa16e4a89158f3d3198db71e2eba3bda9330078 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 10 Sep 2016 13:29:56 +0000 Subject: Make s6-linux-init a real init package. This means: - removing leaky options to s6-linux-init-maker. Default initial_path is now always /usr/bin:/bin; the uid and gid of the catch-all logger (used at boot time) can now be given numerically instead of relying on the (run-time) user db mapping. - moving s6-halt, s6-poweroff and s6-reboot over here, from s6-linux-utils - clarifying on the documentation a bit. --- doc/s6-linux-init-maker.html | 110 ++++++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 42 deletions(-) (limited to 'doc/s6-linux-init-maker.html') diff --git a/doc/s6-linux-init-maker.html b/doc/s6-linux-init-maker.html index e82ce40..4eee9db 100644 --- a/doc/s6-linux-init-maker.html +++ b/doc/s6-linux-init-maker.html @@ -51,8 +51,8 @@ machine - else the scripts will crash. [ -c basedir ] \ [ -l tmpfsdir ] \ [ -b execline_bindir ] \ - [ -u log_user ] \ - [ -g early_getty ] \ + [ -u log_uid -g log_gid | -U ] \ + [ -G early_getty ] \ [ -2 stage2 ] \ [ -r ] \ [ -Z ] stage2_finish \ @@ -173,48 +173,63 @@ real machine and service initialization should happen in stage2.

Shutdown sequence

-

- When s6-svscan is told to exit via an appropriate -s6-svscanctl -command, it executes into the stage3 script, which, like -stage2, is the responsibility of the administrator. stage3 -is run in the following state: -

+ -

- When s6-svscan receives a signal such as SIGINT, typically sent by the -Ctrl-Alt-Del key combination or a reboot or poweroff -command, it will run the corresponding script in -tmpfsdir/service/.s6-svscan, which will first run -stage2_finish, then send an exit command to s6-svscan as -described above. This is useful if some commands need to be run before -s6-svscan executes into stage3: for instance, if the machine -state is maintained by a service manager such as -s6-rc, all the -services can be turned off in stage2_finish while s6-svscan -is still alive, and then the last steps of the shutdown procedure can -be performed in stage3. -

+
  • The last command that stage3 executes should be +s6-$1 -f, $1 being the first argument that has been +given to it. This command will instantly execute the hard system halt, +poweroff or reboot that has initially been asked by the admin.
  • -

    - Generally speaking, stage2_finish should undo what -stage2 has done at boot time, so stage3 has very -little work to do. -

    +

    The examples/ subdirectory of the s6-linux-init package @@ -251,11 +266,24 @@ launcher and the first few early commands before PATH can be set. found. It must be absolute. Default is /bin.

    -

  • -u log_user : the catch-all -logger will not run as root, but as log_user. Default is -nobody.
  • +

  • -u log_uid : the catch-all +logger will run with the uid log_uid. Default is 0.
  • + +

  • -g log_gid : the catch-all +logger will run with the gid log_gid. Default is 0.
  • + +

  • -U : the correct log_uid and +log_gid values for the catch-all logger will be read from the +UID and GID environment variables that have been passed to +s6-linux-init-maker. This allows for invocations such as +s6-envuidgid nobody s6-linux-init-maker -U ... so that +the catch-all logger runs as the nobody user. Be aware that +this option is only safe when the user database on the +boot-time machine is the same as on the run-time +machine, else the catch-all logger may run with an unexpected uid +and gid.
  • -
  • -g early_getty : if this option +
  • -G early_getty : if this option is set, s6-linux-init-maker will define a service that will run very early, before stage2 is executed. This early service should be a getty, to allow logins even if stage2 fails. @@ -297,9 +325,7 @@ absolutely necessary for s6-portable-utils and s6-linux-utils binaries to be accessible via initial_path, else the machine -will not boot. Default is the value that has been compiled in -skalibs via the ---with-default-path configure option, i.e. by default +will not boot. Default is /usr/bin:/bin.
  • -m initial_umask : the value of -- cgit v1.2.3