aboutsummaryrefslogtreecommitdiff
path: root/sbin/init
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2018-08-07 19:23:03 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2018-08-07 19:23:03 +0000
commitfdfbf1278448828fee0bb5153c579f043e036746 (patch)
treeb6f13da1184d66bab43fdd7d6e76fce6637370bb /sbin/init
parente545f5a8a363c14fe89eae82a3c428440c16eaf5 (diff)
downloadsrc-fdfbf1278448828fee0bb5153c579f043e036746.tar.gz
src-fdfbf1278448828fee0bb5153c579f043e036746.zip
Move description of init_shell, init_script, and init_chroot kenv
tunables from loader(8) to init(8), since it's init that actually uses them. Add .Xrs at their old place. MFC after: 2 weeks Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=337435
Diffstat (limited to 'sbin/init')
-rw-r--r--sbin/init/init.870
1 files changed, 69 insertions, 1 deletions
diff --git a/sbin/init/init.8 b/sbin/init/init.8
index cefbf499d98a..89a94a38b448 100644
--- a/sbin/init/init.8
+++ b/sbin/init/init.8
@@ -31,7 +31,7 @@
.\" @(#)init.8 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd October 3, 2016
+.Dd August 7, 2018
.Dt INIT 8
.Os
.Sh NAME
@@ -294,6 +294,74 @@ as follows:
.Xr ttys 5
file
.El
+.Sh KERNEL ENVIRONMENT VARIABLES
+The following
+.Xr kenv 2
+variables are available as
+.Xr loader 8
+tunables:
+.Bl -tag -width indent
+.It Va init_chroot
+If set to a valid directory in the root file system, it causes
+.Nm
+to perform a
+.Xr chroot 2
+operation on that directory, making it the new root directory.
+That happens before entering single-user mode or multi-user
+mode (but after executing the
+.Va init_script
+if enabled).
+This functionality has generally been eclipsed by rerooting.
+See
+.Xr reboot 8
+.Fl r
+for details.
+.It Va init_script
+If set to a valid file name in the root file system,
+instructs
+.Nm
+to run that script as the very first action,
+before doing anything else.
+Signal handling and exit code interpretation is similar to
+running the
+.Pa /etc/rc
+script.
+In particular, single-user operation is enforced
+if the script terminates with a non-zero exit code,
+or if a SIGTERM is delivered to the
+.Nm
+process (PID 1).
+This functionality has generally been eclipsed by rerooting.
+See
+.Xr reboot 8
+.Fl r
+for details.
+.It Va init_shell
+Defines the shell binary to be used for executing the various shell scripts.
+The default is
+.Dq Li /bin/sh .
+It is used for running the
+.Va init_script
+if set, as well as for the
+.Pa /etc/rc
+and
+.Pa /etc/rc.shutdown
+scripts.
+The value of the corresponding
+.Xr kenv 2
+variable is evaluated every time
+.Nm
+calls a shell script, so it can be changed later on using the
+.Xr kenv 1
+utility.
+In particular, if a non-default shell is used for running an
+.Va init_script ,
+it might be desirable to have that script reset the value of
+.Va init_shell
+back to the default, so that the
+.Pa /etc/rc
+script is executed with the standard shell
+.Pa /bin/sh .
.Sh FILES
.Bl -tag -width /var/log/init.log -compact
.It Pa /dev/console