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 |
| 18 | # field is left blank, it is completely ignored. Also note that if |
| 19 | # BusyBox detects that a serial console is in use, then all entries |
Bernhard Reutner-Fischer | 4f3d2de | 2006-04-12 19:14:35 +0000 | [diff] [blame] | 20 | # containing non-empty id fields will be ignored. BusyBox init does |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 21 | # nothing with utmp. We don't need no stinkin' utmp. |
| 22 | # |
| 23 | # <runlevels>: The runlevels field is completely ignored. |
| 24 | # |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 25 | # <action>: Valid actions include: sysinit, respawn, askfirst, wait, once, |
Eric Andersen | 730f826 | 2001-12-17 23:13:08 +0000 | [diff] [blame] | 26 | # restart, ctrlaltdel, and shutdown. |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 27 | # |
| 28 | # Note: askfirst acts just like respawn, but before running the specified |
| 29 | # process it displays the line "Please press Enter to activate this |
| 30 | # console." and then waits for the user to press enter before starting |
| 31 | # the specified process. |
| 32 | # |
Denys Vlasenko | b22bbff | 2009-07-04 16:50:43 +0200 | [diff] [blame] | 33 | # Note: unrecognized actions (like initdefault) will cause init to emit |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 34 | # an error message, and then go along with its business. |
| 35 | # |
| 36 | # <process>: Specifies the process to be executed and it's command line. |
| 37 | # |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 38 | # Note: BusyBox init works just fine without an inittab. If no inittab is |
| 39 | # found, it has the following default behavior: |
| 40 | # ::sysinit:/etc/init.d/rcS |
| 41 | # ::askfirst:/bin/sh |
| 42 | # ::ctrlaltdel:/sbin/reboot |
| 43 | # ::shutdown:/sbin/swapoff -a |
| 44 | # ::shutdown:/bin/umount -a -r |
Eric Andersen | 730f826 | 2001-12-17 23:13:08 +0000 | [diff] [blame] | 45 | # ::restart:/sbin/init |
| 46 | # |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 47 | # if it detects that /dev/console is _not_ a serial console, it will |
| 48 | # also run: |
| 49 | # tty2::askfirst:/bin/sh |
| 50 | # tty3::askfirst:/bin/sh |
| 51 | # tty4::askfirst:/bin/sh |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 52 | # |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 53 | # Boot-time system configuration/initialization script. |
| 54 | # This is run first except when booting in single-user mode. |
| 55 | # |
| 56 | ::sysinit:/etc/init.d/rcS |
| 57 | |
| 58 | # /bin/sh invocations on selected ttys |
| 59 | # |
Eric Andersen | 7e3bf6e | 2000-09-14 22:01:31 +0000 | [diff] [blame] | 60 | # Note below that we prefix the shell commands with a "-" to indicate to the |
| 61 | # shell that it is supposed to be a login shell. Normally this is handled by |
| 62 | # login, but since we are bypassing login in this case, BusyBox lets you do |
| 63 | # this yourself... |
| 64 | # |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 65 | # Start an "askfirst" shell on the console (whatever that may be) |
Eric Andersen | 7e3bf6e | 2000-09-14 22:01:31 +0000 | [diff] [blame] | 66 | ::askfirst:-/bin/sh |
Eric Andersen | 7e3bf6e | 2000-09-14 22:01:31 +0000 | [diff] [blame] | 67 | # Start an "askfirst" shell on /dev/tty2-4 |
| 68 | tty2::askfirst:-/bin/sh |
| 69 | tty3::askfirst:-/bin/sh |
| 70 | tty4::askfirst:-/bin/sh |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 71 | |
| 72 | # /sbin/getty invocations for selected ttys |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 73 | tty4::respawn:/sbin/getty 38400 tty5 |
| 74 | tty5::respawn:/sbin/getty 38400 tty6 |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 75 | |
| 76 | # 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] | 77 | #::respawn:/sbin/getty -L ttyS0 9600 vt100 |
| 78 | #::respawn:/sbin/getty -L ttyS1 9600 vt100 |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 79 | # |
| 80 | # Example how to put a getty on a modem line. |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 81 | #::respawn:/sbin/getty 57600 ttyS2 |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 82 | |
Eric Andersen | 730f826 | 2001-12-17 23:13:08 +0000 | [diff] [blame] | 83 | # Stuff to do when restarting the init process |
| 84 | ::restart:/sbin/init |
| 85 | |
Erik Andersen | d7ce5e78 | 2000-02-09 04:40:25 +0000 | [diff] [blame] | 86 | # Stuff to do before rebooting |
Eric Andersen | 3555fd0 | 2001-07-30 19:28:33 +0000 | [diff] [blame] | 87 | ::ctrlaltdel:/sbin/reboot |
| 88 | ::shutdown:/bin/umount -a -r |
| 89 | ::shutdown:/sbin/swapoff -a |
Erik Andersen | 3695052 | 2000-01-06 01:16:59 +0000 | [diff] [blame] | 90 | |