Scroll to navigation

INITTAB(5) Dateiformate INITTAB(5)

BEZEICHNUNG

inittab - Format der Datei inittab für den SysV-kompatiblen Init-Prozess

BESCHREIBUNG

Die Datei inittab beschreibt, welche Prozesse beim Booten und während des normalen Betriebs gestartet werden (z. B. /etc/init.d/boot, /etc/init.d/rc, gettys …). init(8) unterscheidet mehrere Runlevel, von denen jeder einen eigenen Satz von Prozessen umfasst, die gestartet werden. Gültige Runlevel sind 0-6 plus A, B und C für ondemand-Einträge. Ein Eintrag in der Datei inittab hat folgendes Format:

ID:Runlevel:Aktion:Prozess

Zeilen mit einer Raute »#« am Anfang werden ignoriert.
is a unique sequence of 1–4 characters which identifies an entry in inittab (for versions of sysvinit compiled with the old libc5 (< 5.2.18) or a.out libraries the limit is 2 characters).

Note: traditionally, for getty and other login processes, the value of the id field is kept the same as the suffix of the corresponding tty, e.g. 1 for tty1. Some ancient login accounting programs might expect this, though I can't think of any.

listet die Runlevel, für die die angegebene Aktion durchgeführt werden soll.
beschreibt, was getan werden soll.
specifies the process to be executed. If the process field starts with a `+' character, init will not do utmp and wtmp accounting for that process. This is needed for gettys that insist on doing their own utmp/wtmp housekeeping. This is also a historic bug. The length of this field is limited to 253 characters. Anything beyond 253 will result in a log warning and the process command line being skipped/ignored.

Please note that including certain characters in the process field will result in init attempting to launch a shell to interpret the command contained in the process field. The characters which will trigger a shell are: ~`!$^&*()=|}[];"'<>?

On systems which do not have a shell to be launched or which do not wish to use a shell to interpret the process field, the process field can be prefixed with the @ symbol. The @ will be ignored and everything followed will be treated as a command to be launched, literally, by the init service.

In cases where both a + and @ sign are to be used (to turn off logging and shell interpretation), place the + sign before the @ symbol. Both flags will be handled and then everything following the @ will be handled by init

Das Feld Runlevel kann mehrere Zeichen für verschiedene Runlevel enthalten. Beispielsweise legt 123 fest, dass der Prozess in den Runleveln 1, 2 und 3 gestartet werden soll. Die Runlevel für ondemand-Einträge können A, B oder C enthalten. Das Feld Runlevel der Einträge sysinit, boot und bootwait wird ignoriert.

Bei einem Wechsel des Runlevels des Systems werden alle laufenden Prozesse, die nicht im neuen Runlevel laufen sollen, beendet; zuerst mit SIGTERM, dann mit SIGKILL.

Gültige Einträge für das Aktion-Feld sind:

Der Prozess wird jedesmal, wenn er terminiert, neu gestartet (z.B. getty).
Der Prozess wird einmal beim Eintritt in den Runlevel gestartet und Init(8) wartet auf den Abschluss des Prozesses.
Der Prozess wird einmal während der Initialisierung des Runlevels ausgeführt.
Der Prozess wird ausgeführt, während das System hochfährt. Das Feld Runlevel wird ignoriert.
Der Prozess läuft während des Systemstarts und Init(8) wartet auf seinen Abschluss (z. B. /etc/rc). Das Feld Runlevel wird ignoriert.
Es wird keine Aktion durchgeführt.
Ein mit ondemand gekennzeichneter Prozess wird jedesmal ausgeführt, wenn das angegebene ondemand-Runlevel aufgerufen wird. Es erfolgt aber kein Wechsel des Runlevels. (Die ondemand-Runlevel sind »a«, »b« und »c«.)
An initdefault entry specifies the runlevel which should be entered after system boot. If none exists, init will ask for a runlevel on the console. The process field is ignored.
The process will be executed during system boot. It will be executed before any boot or bootwait entries. The runlevels field is ignored.
The process will be executed when the power goes down. init is usually informed about this by a process talking to a UPS connected to the computer. init will wait for the process to finish before continuing.
Wie powerwait; init(8) wartet aber nicht auf den Abschluss dieses Prozesses.
Dieser Prozess wird ausgeführt, sobald init(8) erfährt, dass die Spannungsversorgung wieder normal funktioniert.
Dieser Prozess wird ausgeführt, wenn init(8) erfährt, dass die Batterie der externen USV fast leer ist und ein Stromausfall droht. Voraussetzung ist natürlich, dass USV und Überwachungsprozess diesen Zustand erkennen können.
The process will be executed when init receives the SIGINT signal. This means that someone on the system console has pressed the CTRL-ALT-DEL key combination. Typically one wants to execute some sort of shutdown either to get into single-user level or to reboot the machine.
Der Prozess wird ausgeführt, wenn der Tastatur-Handler init(8) signalisiert, dass auf der Tastatur der Konsole eine bestimmte Tastenkombination eingegeben wurde.

The documentation for this function is not complete yet; more documentation can be found in the kbd-x.xx packages (most recent was kbd-0.94 at the time of this writing). Basically you want to map some keyboard combination to the "KeyboardSignal" action. For example, to map Alt-Uparrow for this purpose use the following in your keymaps file:

alt keycode 103 = KeyboardSignal

Note: In environments where the directory /etc/inittab.d/ exists, init will read the contents of this directory and open any files with the ".tab" extension. These .tab files can introduce additional lines and settings with the same format as inittab. The .tab files are optional and provide a install-specific method for adding extra options or functionality.

BEISPIELE

Dies ist ein Beispiel für eine inittab, die der alten Linux-inittab ähnelt:

# inittab für Linux
id:1:initdefault:
rc::bootwait:/etc/rc
1:1:respawn:/etc/getty 9600 tty1
2:1:respawn:/etc/getty 9600 tty2
3:1:respawn:/etc/getty 9600 tty3
4:1:respawn:/etc/getty 9600 tty4

Diese inittab-Datei führt beim Systemstart /etc/rc aus und startet Gettys auf tty1 bis tty4.

Eine ausgefeiltere inittab mit verschiedenen Runleveln (siehe die innenstehenden Kommentare):

# Standard-Runlevel
id:2:initdefault:
# Skript für Konfiguration/Initialisierung während
# des Systemstarts
si::sysinit:/etc/init.d/rcS
# Das läuft im Single-User-Modus.
~:S:wait:/sbin/sulogin
# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2–5 are multi-user.
# Runlevel 6 is reboot.
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Was wird beim »Affengriff« getan?
ca::ctrlaltdel:/sbin/shutdown -t1 -h now
# Runlevel 2,3: Getty auf virtuellen Konsolen
# Runlevel   3: Getty auf Terminal (ttyS0) und Modem (ttyS1)
1:23:respawn:/sbin/getty tty1 VC linux
2:23:respawn:/sbin/getty tty2 VC linux
3:23:respawn:/sbin/getty tty3 VC linux
4:23:respawn:/sbin/getty tty4 VC linux
S0:3:respawn:/sbin/getty -L 9600 ttyS0 vt320
S1:3:respawn:/sbin/mgetty -x0 -D ttyS1

DATEIEN

/etc/inittab

AUTOR

Der Autor von init(8) ist Miquel van Smoorenburg. Diese Handbuchseite wurde von Sebastian Lederer geschrieben und von Michael Haardt überarbeitet.

SIEHE AUCH

init(8), telinit(8)

4. Dezember 2001 sysvinit