18fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1991, 1993 28fae3551SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 38fae3551SRodney W. Grimes.\" 48fae3551SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by 58fae3551SRodney W. Grimes.\" Donn Seeley at Berkeley Software Design, Inc. 68fae3551SRodney W. Grimes.\" 78fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 88fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions 98fae3551SRodney W. Grimes.\" are met: 108fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 118fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 128fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 138fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 148fae3551SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 15fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors 168fae3551SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 178fae3551SRodney W. Grimes.\" without specific prior written permission. 188fae3551SRodney W. Grimes.\" 198fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 208fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 218fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 228fae3551SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 238fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 248fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 258fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 268fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 278fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 288fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 298fae3551SRodney W. Grimes.\" SUCH DAMAGE. 308fae3551SRodney W. Grimes.\" 318fae3551SRodney W. Grimes.\" @(#)init.8 8.3 (Berkeley) 4/18/94 327f3dea24SPeter Wemm.\" $FreeBSD$ 338fae3551SRodney W. Grimes.\" 34*5fda0d60SAndriy Gapon.Dd August 6, 2019 358fae3551SRodney W. Grimes.Dt INIT 8 369fe48c6eSRuslan Ermilov.Os 378fae3551SRodney W. Grimes.Sh NAME 388fae3551SRodney W. Grimes.Nm init 398fae3551SRodney W. Grimes.Nd process control initialization 408fae3551SRodney W. Grimes.Sh SYNOPSIS 417c7fb079SRuslan Ermilov.Nm 427c7fb079SRuslan Ermilov.Nm 431681d659SRuslan Ermilov.Oo 441681d659SRuslan Ermilov.Cm 0 | 1 | 6 | 451681d659SRuslan Ermilov.Cm c | q 461681d659SRuslan Ermilov.Oc 478fae3551SRodney W. Grimes.Sh DESCRIPTION 488fae3551SRodney W. GrimesThe 495df42cf4SPhilippe Charnier.Nm 50e1205e80SPhilippe Charnierutility 518fae3551SRodney W. Grimesis the last stage of the boot process. 528fae3551SRodney W. GrimesIt normally runs the automatic reboot sequence as described in 531681d659SRuslan Ermilov.Xr rc 8 , 548fae3551SRodney W. Grimesand if this succeeds, begins multi-user operation. 558fae3551SRodney W. GrimesIf the reboot scripts fail, 565df42cf4SPhilippe Charnier.Nm 571681d659SRuslan Ermilovcommences single-user operation by giving 588fae3551SRodney W. Grimesthe super-user a shell on the console. 598fae3551SRodney W. GrimesThe 605df42cf4SPhilippe Charnier.Nm 61e1205e80SPhilippe Charnierutility may be passed parameters 628fae3551SRodney W. Grimesfrom the boot program to 638fae3551SRodney W. Grimesprevent the system from going multi-user and to instead execute 641681d659SRuslan Ermilova single-user shell without starting the normal daemons. 658fae3551SRodney W. GrimesThe system is then quiescent for maintenance work and may 668fae3551SRodney W. Grimeslater be made to go to multi-user by exiting the 678fae3551SRodney W. Grimessingle-user shell (with ^D). 688fae3551SRodney W. GrimesThis 698fae3551SRodney W. Grimescauses 705df42cf4SPhilippe Charnier.Nm 718fae3551SRodney W. Grimesto run the 728fae3551SRodney W. Grimes.Pa /etc/rc 738fae3551SRodney W. Grimesstart up command file in fastboot mode (skipping disk checks). 748fae3551SRodney W. Grimes.Pp 758fae3551SRodney W. GrimesIf the 765df42cf4SPhilippe Charnier.Em console 778fae3551SRodney W. Grimesentry in the 788fae3551SRodney W. Grimes.Xr ttys 5 791681d659SRuslan Ermilovfile is marked 801681d659SRuslan Ermilov.Dq insecure , 818fae3551SRodney W. Grimesthen 825df42cf4SPhilippe Charnier.Nm 831681d659SRuslan Ermilovwill require that the super-user password be 848fae3551SRodney W. Grimesentered before the system will start a single-user shell. 858fae3551SRodney W. GrimesThe password check is skipped if the 865df42cf4SPhilippe Charnier.Em console 871681d659SRuslan Ermilovis marked as 881681d659SRuslan Ermilov.Dq secure . 895469cc0eSEdward Tomasz NapieralaNote that the password check does not protect from variables 905469cc0eSEdward Tomasz Napieralasuch as 915469cc0eSEdward Tomasz Napierala.Va init_script 925469cc0eSEdward Tomasz Napieralabeing set from the 935469cc0eSEdward Tomasz Napierala.Xr loader 8 945469cc0eSEdward Tomasz Napieralacommand line; see the 955469cc0eSEdward Tomasz Napierala.Sx SECURITY 965469cc0eSEdward Tomasz Napieralasection of 975469cc0eSEdward Tomasz Napierala.Xr loader 8 . 988fae3551SRodney W. Grimes.Pp 99e17c0e32SGary W. SwearingenIf the system security level (see 100e17c0e32SGary W. Swearingen.Xr security 7 ) 101e17c0e32SGary W. Swearingenis initially nonzero, then 1025df42cf4SPhilippe Charnier.Nm 10338058917SBruce Evansleaves it unchanged. 10438058917SBruce EvansOtherwise, 1055df42cf4SPhilippe Charnier.Nm 10667b661fdSSheldon Hearnraises the level to 1 before going multi-user for the first time. 10701de0116SSheldon HearnSince the level cannot be reduced, it will be at least 1 for 10801de0116SSheldon Hearnsubsequent operation, even on return to single-user. 10967b661fdSSheldon HearnIf a level higher than 1 is desired while running multi-user, 11067b661fdSSheldon Hearnit can be set before going multi-user, e.g., by the startup script 11167b661fdSSheldon Hearn.Xr rc 8 , 1128fae3551SRodney W. Grimesusing 1136ebaa024SJoseph Koshy.Xr sysctl 8 1146ebaa024SJoseph Koshyto set the 115280b191cSKen Smith.Va kern.securelevel 1166ebaa024SJoseph Koshyvariable to the required security level. 1178fae3551SRodney W. Grimes.Pp 118280b191cSKen SmithIf 119280b191cSKen Smith.Nm 120d04b5dfeSRuslan Ermilovis run in a jail, the security level of the 121280b191cSKen Smith.Dq host system 1227090a0c6SRalf S. Engelschallwill not be affected. 123280b191cSKen SmithPart of the information set up in the kernel to support a jail 124e17c0e32SGary W. Swearingenis a per-jail security level. 125280b191cSKen SmithThis allows running a higher security level inside of a jail 126280b191cSKen Smiththan that of the host system. 127280b191cSKen SmithSee 128280b191cSKen Smith.Xr jail 8 129280b191cSKen Smithfor more information about jails. 130280b191cSKen Smith.Pp 1318fae3551SRodney W. GrimesIn multi-user operation, 1325df42cf4SPhilippe Charnier.Nm 1338fae3551SRodney W. Grimesmaintains 1348fae3551SRodney W. Grimesprocesses for the terminal ports found in the file 1358fae3551SRodney W. Grimes.Xr ttys 5 . 136e1205e80SPhilippe CharnierThe 137e1205e80SPhilippe Charnier.Nm 138e1205e80SPhilippe Charnierutility reads this file and executes the command found in the second field, 139f0f4f756SSheldon Hearnunless the first field refers to a device in 140f0f4f756SSheldon Hearn.Pa /dev 141f0f4f756SSheldon Hearnwhich is not configured. 142f0f4f756SSheldon HearnThe first field is supplied as the final argument to the command. 1438fae3551SRodney W. GrimesThis command is usually 1448fae3551SRodney W. Grimes.Xr getty 8 ; 145edf0e5b3SMike Pritchard.Nm getty 1468fae3551SRodney W. Grimesopens and initializes the tty line 1478fae3551SRodney W. Grimesand 1488fae3551SRodney W. Grimesexecutes the 149edf0e5b3SMike Pritchard.Xr login 1 1508fae3551SRodney W. Grimesprogram. 1518fae3551SRodney W. GrimesThe 152edf0e5b3SMike Pritchard.Nm login 1538fae3551SRodney W. Grimesprogram, when a valid user logs in, 1549806e231SRuslan Ermilovexecutes a shell for that user. 1559806e231SRuslan ErmilovWhen this shell 1568fae3551SRodney W. Grimesdies, either because the user logged out 1578fae3551SRodney W. Grimesor an abnormal termination occurred (a signal), 158c21ae3a4SEd Schoutenthe cycle is restarted by 1598fae3551SRodney W. Grimesexecuting a new 160edf0e5b3SMike Pritchard.Nm getty 1618fae3551SRodney W. Grimesfor the line. 1628fae3551SRodney W. Grimes.Pp 163e1205e80SPhilippe CharnierThe 164e1205e80SPhilippe Charnier.Nm 165e1205e80SPhilippe Charnierutility can also be used to keep arbitrary daemons running, 166f0f4f756SSheldon Hearnautomatically restarting them if they die. 167f0f4f756SSheldon HearnIn this case, the first field in the 168f0f4f756SSheldon Hearn.Xr ttys 5 169f0f4f756SSheldon Hearnfile must not reference the path to a configured device node 170f0f4f756SSheldon Hearnand will be passed to the daemon 171f0f4f756SSheldon Hearnas the final argument on its command line. 172f0f4f756SSheldon HearnThis is similar to the facility offered in the 173f0f4f756SSheldon Hearn.At V 174f0f4f756SSheldon Hearn.Pa /etc/inittab . 175f0f4f756SSheldon Hearn.Pp 1768fae3551SRodney W. GrimesLine status (on, off, secure, getty, or window information) 1778fae3551SRodney W. Grimesmay be changed in the 178edf0e5b3SMike Pritchard.Xr ttys 5 1798fae3551SRodney W. Grimesfile without a reboot by sending the signal 1808fae3551SRodney W. Grimes.Dv SIGHUP 1818fae3551SRodney W. Grimesto 1825df42cf4SPhilippe Charnier.Nm 1838fae3551SRodney W. Grimeswith the command 1848fae3551SRodney W. Grimes.Dq Li "kill -HUP 1" . 1858fae3551SRodney W. GrimesOn receipt of this signal, 1865df42cf4SPhilippe Charnier.Nm 1878fae3551SRodney W. Grimesre-reads the 188edf0e5b3SMike Pritchard.Xr ttys 5 1898fae3551SRodney W. Grimesfile. 1908fae3551SRodney W. GrimesWhen a line is turned off in 191edf0e5b3SMike Pritchard.Xr ttys 5 , 1925df42cf4SPhilippe Charnier.Nm 1938fae3551SRodney W. Grimeswill send a SIGHUP signal to the controlling process 1948fae3551SRodney W. Grimesfor the session associated with the line. 1958fae3551SRodney W. GrimesFor any lines that were previously turned off in the 196edf0e5b3SMike Pritchard.Xr ttys 5 1978fae3551SRodney W. Grimesfile and are now on, 1985df42cf4SPhilippe Charnier.Nm 199f0f4f756SSheldon Hearnexecutes the command specified in the second field. 200f0f4f756SSheldon HearnIf the command or window field for a line is changed, 2018fae3551SRodney W. Grimesthe change takes effect at the end of the current 2028fae3551SRodney W. Grimeslogin session (e.g., the next time 2035df42cf4SPhilippe Charnier.Nm 2048fae3551SRodney W. Grimesstarts a process on the line). 2058fae3551SRodney W. GrimesIf a line is commented out or deleted from 206edf0e5b3SMike Pritchard.Xr ttys 5 , 2075df42cf4SPhilippe Charnier.Nm 2088fae3551SRodney W. Grimeswill not do anything at all to that line. 2098fae3551SRodney W. Grimes.Pp 210e1205e80SPhilippe CharnierThe 211e1205e80SPhilippe Charnier.Nm 212e1205e80SPhilippe Charnierutility will terminate multi-user operations and resume single-user mode 2138fae3551SRodney W. Grimesif sent a terminate 2148fae3551SRodney W. Grimes.Pq Dv TERM 2158fae3551SRodney W. Grimessignal, for example, 2168fae3551SRodney W. Grimes.Dq Li "kill \-TERM 1" . 2178fae3551SRodney W. GrimesIf there are processes outstanding that are deadlocked (because of 2188fae3551SRodney W. Grimeshardware or software failure), 2195df42cf4SPhilippe Charnier.Nm 2208fae3551SRodney W. Grimeswill not wait for them all to die (which might take forever), but 2218fae3551SRodney W. Grimeswill time out after 30 seconds and print a warning message. 2228fae3551SRodney W. Grimes.Pp 223e1205e80SPhilippe CharnierThe 224e1205e80SPhilippe Charnier.Nm 225e1205e80SPhilippe Charnierutility will cease creating new processes 2268fae3551SRodney W. Grimesand allow the system to slowly die away, if it is sent a terminal stop 2278fae3551SRodney W. Grimes.Pq Dv TSTP 22857e4378bSRuslan Ermilovsignal, i.e.\& 2298fae3551SRodney W. Grimes.Dq Li "kill \-TSTP 1" . 2308fae3551SRodney W. GrimesA later hangup will resume full 2311681d659SRuslan Ermilovmulti-user operations, or a terminate will start a single-user shell. 2328fae3551SRodney W. GrimesThis hook is used by 2338fae3551SRodney W. Grimes.Xr reboot 8 2348fae3551SRodney W. Grimesand 2358fae3551SRodney W. Grimes.Xr halt 8 . 2368fae3551SRodney W. Grimes.Pp 237e1205e80SPhilippe CharnierThe 238e1205e80SPhilippe Charnier.Nm 239e1205e80SPhilippe Charnierutility will terminate all possible processes (again, it will not wait 240e460cfd3SNate Williamsfor deadlocked processes) and reboot the machine if sent the interrupt 241e460cfd3SNate Williams.Pq Dv INT 24257e4378bSRuslan Ermilovsignal, i.e.\& 243e460cfd3SNate Williams.Dq Li "kill \-INT 1". 244e460cfd3SNate WilliamsThis is useful for shutting the machine down cleanly from inside the kernel 2454f3cac8fSAdam Davidor from X when the machine appears to be hung. 246e460cfd3SNate Williams.Pp 247e1205e80SPhilippe CharnierThe 248e1205e80SPhilippe Charnier.Nm 249e1205e80SPhilippe Charnierutility will do the same, except it will halt the machine if sent 250a0a549c7SRuslan Ermilovthe user defined signal 1 251a0a549c7SRuslan Ermilov.Pq Dv USR1 , 2521681d659SRuslan Ermilovor will halt and turn the power off (if hardware permits) if sent 253a0a549c7SRuslan Ermilovthe user defined signal 2 254a0a549c7SRuslan Ermilov.Pq Dv USR2 . 255a0a549c7SRuslan Ermilov.Pp 2566ebaa024SJoseph KoshyWhen shutting down the machine, 2575df42cf4SPhilippe Charnier.Nm 2588889c700SDavid Nugentwill try to run the 2598889c700SDavid Nugent.Pa /etc/rc.shutdown 260ef8f7ac9SSheldon Hearnscript. 261ef8f7ac9SSheldon HearnThis script can be used to cleanly terminate specific programs such 2628889c700SDavid Nugentas 2638889c700SDavid Nugent.Nm innd 2648889c700SDavid Nugent(the InterNetNews server). 265724447acSRalf S. EngelschallIf this script does not terminate within 120 seconds, 266724447acSRalf S. Engelschall.Nm 2674e9e907dSRuslan Ermilovwill terminate it. 2684e9e907dSRuslan ErmilovThe timeout can be configured via the 269724447acSRalf S. Engelschall.Xr sysctl 8 270724447acSRalf S. Engelschallvariable 271724447acSRalf S. Engelschall.Va kern.init_shutdown_timeout . 2728889c700SDavid Nugent.Pp 273*5fda0d60SAndriy Gapon.Nm init 274*5fda0d60SAndriy Gaponpasses 275*5fda0d60SAndriy Gapon.Dq Li single 276*5fda0d60SAndriy Gaponas the argument to the shutdown script if return to single-user mode 277*5fda0d60SAndriy Gaponis requested. 278*5fda0d60SAndriy GaponOtherwise, 279*5fda0d60SAndriy Gapon.Dq Li reboot 280*5fda0d60SAndriy Gaponargument is used. 281*5fda0d60SAndriy Gapon.Pp 2828fae3551SRodney W. GrimesThe role of 2835df42cf4SPhilippe Charnier.Nm 2848fae3551SRodney W. Grimesis so critical that if it dies, the system will reboot itself 2858fae3551SRodney W. Grimesautomatically. 2868fae3551SRodney W. GrimesIf, at bootstrap time, the 2875df42cf4SPhilippe Charnier.Nm 2888fae3551SRodney W. Grimesprocess cannot be located, the system will panic with the message 2891681d659SRuslan Ermilov.Dq "panic: init died (signal %d, exit %d)" . 2901681d659SRuslan Ermilov.Pp 2915d94d8b6SRuslan ErmilovIf run as a user process as shown in the second synopsis line, 2921681d659SRuslan Ermilov.Nm 2931681d659SRuslan Ermilovwill emulate 2941681d659SRuslan Ermilov.At V 2959806e231SRuslan Ermilovbehavior, i.e., super-user can specify the desired 2961681d659SRuslan Ermilov.Em run-level 2971681d659SRuslan Ermilovon a command line, and 2981681d659SRuslan Ermilov.Nm 2991681d659SRuslan Ermilovwill signal the original 300c4d9468eSRuslan Ermilov(PID 1) 3011681d659SRuslan Ermilov.Nm 3021681d659SRuslan Ermilovas follows: 3031681d659SRuslan Ermilov.Bl -column Run-level SIGTERM 304c2965cd1SJoel Dahl.It Sy "Run-level Signal Action" 305ef159a1bSEdward Tomasz Napierala.It Cm 0 Ta Dv SIGUSR1 Ta "Halt" 3061681d659SRuslan Ermilov.It Cm 0 Ta Dv SIGUSR2 Ta "Halt and turn the power off" 30735c1d16eSWarner Losh.It Cm 0 Ta Dv SIGWINCH Ta "Halt and turn the power off and then back on" 3081681d659SRuslan Ermilov.It Cm 1 Ta Dv SIGTERM Ta "Go to single-user mode" 3091681d659SRuslan Ermilov.It Cm 6 Ta Dv SIGINT Ta "Reboot the machine" 3101681d659SRuslan Ermilov.It Cm c Ta Dv SIGTSTP Ta "Block further logins" 3111681d659SRuslan Ermilov.It Cm q Ta Dv SIGHUP Ta Rescan the 3121681d659SRuslan Ermilov.Xr ttys 5 3131681d659SRuslan Ermilovfile 3141681d659SRuslan Ermilov.El 315fdfbf127SEdward Tomasz Napierala.Sh KERNEL ENVIRONMENT VARIABLES 316fdfbf127SEdward Tomasz NapieralaThe following 317fdfbf127SEdward Tomasz Napierala.Xr kenv 2 318fdfbf127SEdward Tomasz Napieralavariables are available as 319fdfbf127SEdward Tomasz Napierala.Xr loader 8 320fdfbf127SEdward Tomasz Napieralatunables: 321fdfbf127SEdward Tomasz Napierala.Bl -tag -width indent 322fdfbf127SEdward Tomasz Napierala.It Va init_chroot 323fdfbf127SEdward Tomasz NapieralaIf set to a valid directory in the root file system, it causes 324fdfbf127SEdward Tomasz Napierala.Nm 325fdfbf127SEdward Tomasz Napieralato perform a 326fdfbf127SEdward Tomasz Napierala.Xr chroot 2 327fdfbf127SEdward Tomasz Napieralaoperation on that directory, making it the new root directory. 328fdfbf127SEdward Tomasz NapieralaThat happens before entering single-user mode or multi-user 329fdfbf127SEdward Tomasz Napieralamode (but after executing the 330fdfbf127SEdward Tomasz Napierala.Va init_script 331fdfbf127SEdward Tomasz Napieralaif enabled). 332fdfbf127SEdward Tomasz NapieralaThis functionality has generally been eclipsed by rerooting. 333fdfbf127SEdward Tomasz NapieralaSee 334fdfbf127SEdward Tomasz Napierala.Xr reboot 8 335fdfbf127SEdward Tomasz Napierala.Fl r 336fdfbf127SEdward Tomasz Napieralafor details. 337335fe94fSEdward Tomasz Napierala.It Va init_exec 338335fe94fSEdward Tomasz NapieralaIf set to a valid file name in the root file system, 339335fe94fSEdward Tomasz Napieralainstructs 340335fe94fSEdward Tomasz Napierala.Nm 341335fe94fSEdward Tomasz Napieralato directly execute that file as the very first action, 342335fe94fSEdward Tomasz Napieralareplacing 343335fe94fSEdward Tomasz Napierala.Nm 344335fe94fSEdward Tomasz Napieralaas PID 1. 345fdfbf127SEdward Tomasz Napierala.It Va init_script 346fdfbf127SEdward Tomasz NapieralaIf set to a valid file name in the root file system, 347fdfbf127SEdward Tomasz Napieralainstructs 348fdfbf127SEdward Tomasz Napierala.Nm 349fdfbf127SEdward Tomasz Napieralato run that script as the very first action, 350fdfbf127SEdward Tomasz Napieralabefore doing anything else. 351fdfbf127SEdward Tomasz NapieralaSignal handling and exit code interpretation is similar to 352fdfbf127SEdward Tomasz Napieralarunning the 353fdfbf127SEdward Tomasz Napierala.Pa /etc/rc 354fdfbf127SEdward Tomasz Napieralascript. 355fdfbf127SEdward Tomasz NapieralaIn particular, single-user operation is enforced 356fdfbf127SEdward Tomasz Napieralaif the script terminates with a non-zero exit code, 357fdfbf127SEdward Tomasz Napieralaor if a SIGTERM is delivered to the 358fdfbf127SEdward Tomasz Napierala.Nm 359fdfbf127SEdward Tomasz Napieralaprocess (PID 1). 360fdfbf127SEdward Tomasz NapieralaThis functionality has generally been eclipsed by rerooting. 361fdfbf127SEdward Tomasz NapieralaSee 362fdfbf127SEdward Tomasz Napierala.Xr reboot 8 363fdfbf127SEdward Tomasz Napierala.Fl r 364fdfbf127SEdward Tomasz Napieralafor details. 365fdfbf127SEdward Tomasz Napierala.It Va init_shell 366fdfbf127SEdward Tomasz NapieralaDefines the shell binary to be used for executing the various shell scripts. 367fdfbf127SEdward Tomasz NapieralaThe default is 368fdfbf127SEdward Tomasz Napierala.Dq Li /bin/sh . 369fdfbf127SEdward Tomasz NapieralaIt is used for running the 370335fe94fSEdward Tomasz Napierala.Va init_exec 371335fe94fSEdward Tomasz Napieralaor 372fdfbf127SEdward Tomasz Napierala.Va init_script 373fdfbf127SEdward Tomasz Napieralaif set, as well as for the 374fdfbf127SEdward Tomasz Napierala.Pa /etc/rc 375fdfbf127SEdward Tomasz Napieralaand 376fdfbf127SEdward Tomasz Napierala.Pa /etc/rc.shutdown 377fdfbf127SEdward Tomasz Napieralascripts. 378fdfbf127SEdward Tomasz NapieralaThe value of the corresponding 379fdfbf127SEdward Tomasz Napierala.Xr kenv 2 380fdfbf127SEdward Tomasz Napieralavariable is evaluated every time 381fdfbf127SEdward Tomasz Napierala.Nm 382fdfbf127SEdward Tomasz Napieralacalls a shell script, so it can be changed later on using the 383fdfbf127SEdward Tomasz Napierala.Xr kenv 1 384fdfbf127SEdward Tomasz Napieralautility. 385fdfbf127SEdward Tomasz NapieralaIn particular, if a non-default shell is used for running an 386fdfbf127SEdward Tomasz Napierala.Va init_script , 387fdfbf127SEdward Tomasz Napieralait might be desirable to have that script reset the value of 388fdfbf127SEdward Tomasz Napierala.Va init_shell 389fdfbf127SEdward Tomasz Napieralaback to the default, so that the 390fdfbf127SEdward Tomasz Napierala.Pa /etc/rc 391fdfbf127SEdward Tomasz Napieralascript is executed with the standard shell 392fdfbf127SEdward Tomasz Napierala.Pa /bin/sh . 3938fae3551SRodney W. Grimes.Sh FILES 3944c2c7b2cSEd Schouten.Bl -tag -width /var/log/init.log -compact 3958fae3551SRodney W. Grimes.It Pa /dev/console 3965df42cf4SPhilippe Charniersystem console device 3978fae3551SRodney W. Grimes.It Pa /dev/tty* 3985df42cf4SPhilippe Charnierterminal ports found in 3995df42cf4SPhilippe Charnier.Xr ttys 5 4008fae3551SRodney W. Grimes.It Pa /etc/ttys 4015df42cf4SPhilippe Charnierthe terminal initialization information file 4028fae3551SRodney W. Grimes.It Pa /etc/rc 4035df42cf4SPhilippe Charniersystem startup commands 4048889c700SDavid Nugent.It Pa /etc/rc.shutdown 4055df42cf4SPhilippe Charniersystem shutdown commands 4064c2c7b2cSEd Schouten.It Pa /var/log/init.log 4074c2c7b2cSEd Schoutenlog of 4084c2c7b2cSEd Schouten.Xr rc 8 4094c2c7b2cSEd Schoutenoutput if the system console device is not available 4108fae3551SRodney W. Grimes.El 4116087df9eSRuslan Ermilov.Sh DIAGNOSTICS 4126087df9eSRuslan Ermilov.Bl -diag 4136087df9eSRuslan Ermilov.It "getty repeating too quickly on port %s, sleeping." 4146087df9eSRuslan ErmilovA process being started to service a line is exiting quickly 4156087df9eSRuslan Ermiloveach time it is started. 4166087df9eSRuslan ErmilovThis is often caused by a ringing or noisy terminal line. 4176087df9eSRuslan Ermilov.Bf -emphasis 4186087df9eSRuslan ErmilovInit will sleep for 30 seconds, 4196087df9eSRuslan Ermilovthen continue trying to start the process. 4206087df9eSRuslan Ermilov.Ef 4216087df9eSRuslan Ermilov.It "some processes would not die; ps axl advised." 4226087df9eSRuslan ErmilovA process 4236087df9eSRuslan Ermilovis hung and could not be killed when the system was shutting down. 4246087df9eSRuslan ErmilovThis condition is usually caused by a process 4256087df9eSRuslan Ermilovthat is stuck in a device driver because of 4266087df9eSRuslan Ermilova persistent device error condition. 4276087df9eSRuslan Ermilov.El 4288fae3551SRodney W. Grimes.Sh SEE ALSO 4298fae3551SRodney W. Grimes.Xr kill 1 , 430af202156SWolfram Schneider.Xr login 1 , 4318fae3551SRodney W. Grimes.Xr sh 1 , 4328fae3551SRodney W. Grimes.Xr ttys 5 , 4334e9e907dSRuslan Ermilov.Xr security 7 , 4348fae3551SRodney W. Grimes.Xr getty 8 , 435af202156SWolfram Schneider.Xr halt 8 , 436280b191cSKen Smith.Xr jail 8 , 4378fae3551SRodney W. Grimes.Xr rc 8 , 4388fae3551SRodney W. Grimes.Xr reboot 8 , 4396ebaa024SJoseph Koshy.Xr shutdown 8 , 4406ebaa024SJoseph Koshy.Xr sysctl 8 4418fae3551SRodney W. Grimes.Sh HISTORY 442a0a549c7SRuslan ErmilovAn 4438fae3551SRodney W. Grimes.Nm 444e1205e80SPhilippe Charnierutility appeared in 4452580acbeSSevan Janiyan.At v1 . 4466ebaa024SJoseph Koshy.Sh CAVEATS 4478fae3551SRodney W. GrimesSystems without 4489680d7b6SPhilippe Charnier.Xr sysctl 8 4498fae3551SRodney W. Grimesbehave as though they have security level \-1. 4506ebaa024SJoseph Koshy.Pp 45104b2ac6eSGuy HelmerSetting the security level above 1 too early in the boot sequence can 4526ebaa024SJoseph Koshyprevent 4536ebaa024SJoseph Koshy.Xr fsck 8 4549806e231SRuslan Ermilovfrom repairing inconsistent file systems. 4559806e231SRuslan ErmilovThe 4566ebaa024SJoseph Koshypreferred location to set the security level is at the end of 4576ebaa024SJoseph Koshy.Pa /etc/rc 4586ebaa024SJoseph Koshyafter all multi-user startup actions are complete. 459