Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 1 | # /etc/inittab init(8) configuration for BusyBox |
| 2 | # |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 4 | # |
| 5 | # |
| 6 | # Note, BusyBox init doesn't support runlevels. The runlevels field is |
| 7 | # completely ignored by BusyBox init. If you want runlevels, use sysvinit. |
| 8 | # |
| 9 | # |
| 10 | # Format for each entry: <id>:<runlevels>:<action>:<process> |
| 11 | # |
| 12 | # <id>: WARNING: This field has a non-traditional meaning for BusyBox init! |
| 13 | # |
| 14 | # The id field is used by BusyBox init to specify the controlling tty for |
| 15 | # the specified process to run on. The contents of this field are |
| 16 | # appended to "/dev/" and used as-is. There is no need for this field to |
| 17 | # be unique, although if it isn't you may have strange results. If this |
Denys Vlasenko | 2c0508b | 2013-03-29 14:35:44 +0100 | [diff] [blame] | 18 | # field is left blank, then the init's stdin/out will be used. |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 19 | # |
| 20 | # <runlevels>: The runlevels field is completely ignored. |
| 21 | # |
Denys Vlasenko | 419d029 | 2019-11-17 17:48:53 +0100 | [diff] [blame] | 22 | # <action>: Valid actions include: sysinit, wait, once, respawn, askfirst, |
| 23 | # shutdown, restart and ctrlaltdel. |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 24 | # |
Denys Vlasenko | 419d029 | 2019-11-17 17:48:53 +0100 | [diff] [blame] | 25 | # sysinit actions are started first, and init waits for them to complete. |
| 26 | # wait actions are started next, and init waits for them to complete. |
| 27 | # once actions are started next (and not waited for). |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 28 | # |
Denys Vlasenko | 419d029 | 2019-11-17 17:48:53 +0100 | [diff] [blame] | 29 | # askfirst and respawn are started next. |
| 30 | # For askfirst, before running the specified process, init displays |
| 31 | # the line "Please press Enter to activate this console" |
| 32 | # and then waits for the user to press enter before starting it. |
| 33 | # |
| 34 | # shutdown actions are run on halt/reboot/poweroff, or on SIGQUIT. |
| 35 | # Then the machine is halted/rebooted/powered off, or for SIGQUIT, |
| 36 | # restart action is exec'ed (init process is replaced by that process). |
| 37 | # If no restart action specified, SIGQUIT has no effect. |
| 38 | # |
| 39 | # ctrlaltdel actions are run when SIGINT is received |
| 40 | # (this might be initiated by Ctrl-Alt-Del key combination). |
| 41 | # After they complete, normal processing of askfirst / respawn resumes. |
| 42 | # |
| 43 | # Note: unrecognized actions (like initdefault) will cause init to emit |
| 44 | # an error message, and then go along with its business. |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 45 | # |
| 46 | # <process>: Specifies the process to be executed and it's command line. |
| 47 | # |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 48 | # Note: BusyBox init works just fine without an inittab. If no inittab is |
| 49 | # found, it has the following default behavior: |
Denys Vlasenko | 419d029 | 2019-11-17 17:48:53 +0100 | [diff] [blame] | 50 | # ::sysinit:/etc/init.d/rcS |
| 51 | # ::askfirst:/bin/sh |
| 52 | # ::ctrlaltdel:/sbin/reboot |
| 53 | # ::shutdown:/sbin/swapoff -a |
| 54 | # ::shutdown:/bin/umount -a -r |
| 55 | # ::restart:/sbin/init |
| 56 | # tty2::askfirst:/bin/sh |
| 57 | # tty3::askfirst:/bin/sh |
| 58 | # tty4::askfirst:/bin/sh |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 59 | # |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 60 | # Boot-time system configuration/initialization script. |
| 61 | # This is run first except when booting in single-user mode. |
| 62 | # |
| 63 | ::sysinit:/etc/init.d/rcS |
| 64 | |
| 65 | # /bin/sh invocations on selected ttys |
| 66 | # |
Eric Andersen | 7e3bf6e | 2000-09-14 22:01:31 +0000 | [diff] [blame] | 67 | # Note below that we prefix the shell commands with a "-" to indicate to the |
| 68 | # shell that it is supposed to be a login shell. Normally this is handled by |
| 69 | # login, but since we are bypassing login in this case, BusyBox lets you do |
| 70 | # this yourself... |
| 71 | # |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 72 | # Start an "askfirst" shell on the console (whatever that may be) |
Eric Andersen | 7e3bf6e | 2000-09-14 22:01:31 +0000 | [diff] [blame] | 73 | ::askfirst:-/bin/sh |
Eric Andersen | 7e3bf6e | 2000-09-14 22:01:31 +0000 | [diff] [blame] | 74 | # Start an "askfirst" shell on /dev/tty2-4 |
| 75 | tty2::askfirst:-/bin/sh |
| 76 | tty3::askfirst:-/bin/sh |
| 77 | tty4::askfirst:-/bin/sh |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 78 | |
| 79 | # /sbin/getty invocations for selected ttys |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 80 | tty4::respawn:/sbin/getty 38400 tty5 |
| 81 | tty5::respawn:/sbin/getty 38400 tty6 |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 82 | |
| 83 | # Example of how to put a getty on a serial line (for a terminal) |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 84 | #::respawn:/sbin/getty -L ttyS0 9600 vt100 |
| 85 | #::respawn:/sbin/getty -L ttyS1 9600 vt100 |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 86 | # |
| 87 | # Example how to put a getty on a modem line. |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 88 | #::respawn:/sbin/getty 57600 ttyS2 |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 89 | |
Eric Andersen | 730f826 | 2001-12-17 23:13:08 +0000 | [diff] [blame] | 90 | # Stuff to do when restarting the init process |
| 91 | ::restart:/sbin/init |
| 92 | |
Erik Andersen | d7ce5e78 | 2000-02-09 04:40:25 +0000 | [diff] [blame] | 93 | # Stuff to do before rebooting |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 94 | ::ctrlaltdel:/sbin/reboot |
| 95 | ::shutdown:/bin/umount -a -r |
| 96 | ::shutdown:/sbin/swapoff -a |