NoPaste

man init

von RobertDebiannutzer

SNIPPET_TEXT:
  1. INIT(8)                                                                               Linux System Administrator's Manual                                                                              INIT(8)
  2.  
  3. NAME
  4.        init, telinit - process control initialization
  5.  
  6. SYNOPSIS
  7.        /sbin/init [ -a ] [ -s ] [ -b ] [ -z xxx ] [ 0123456Ss ]
  8.        /sbin/telinit [ -t SECONDS ] [ 0123456sSQqabcUu ]
  9.        /sbin/telinit [ -e VAR[=VAL] ]
  10.  
  11. DESCRIPTION
  12.    Init
  13.        Init  is the parent of all processes.  Its primary role is to create processes from a script stored in the file /etc/inittab (see inittab(5)).  This file usually has entries which cause init to spawn
  14.        gettys on each line that users can log in.  It also controls autonomous processes required by any particular system.
  15.  
  16. RUNLEVELS
  17.        A runlevel is a software configuration of the system which allows only a selected group of processes to exist.  The processes spawned by init for each of these runlevels are defined in the /etc/init‐
  18.        tab  file.   Init  can  be in one of eight runlevels: 0–6 and S (a.k.a. s).  The runlevel is changed by having a privileged user run telinit, which sends appropriate signals to init, telling it which
  19.        runlevel to change to.
  20.  
  21.        Runlevels S, 0, 1, and 6 are reserved.  Runlevel S is used to initialize the system on boot.  When starting runlevel S (on boot) or runlevel 1 (switching from a multi-user  runlevel)  the  system  is
  22.        entering ``single-user mode'', after which the current runlevel is S.  Runlevel 0 is used to halt the system; runlevel 6 is used to reboot the system.
  23.  
  24.        After  booting  through  S  the system automatically enters one of the multi-user runlevels 2 through 5, unless there was some problem that needs to be fixed by the administrator in single-user mode.
  25.        Normally after entering single-user mode the administrator performs maintenance and then reboots the system.
  26.  
  27.        For more information, see the manpages for shutdown(8) and inittab(5).
  28.  
  29.        Runlevels 7-9 are also valid, though not really documented. This is because "traditional" Unix variants don't use them.
  30.  
  31.        Runlevels S and s are the same.  Internally they are aliases for the same runlevel.
  32.  
  33. BOOTING
  34.        After init is invoked as the last step of the kernel boot sequence, it looks for the file /etc/inittab to see if there is an entry of the type initdefault  (see  inittab(5)).  The  initdefault  entry
  35.        determines the initial runlevel of the system.  If there is no such entry (or no /etc/inittab at all), a runlevel must be entered at the system console.
  36.  
  37.        Runlevel S or s initialize the system and do not require an /etc/inittab file.
  38.  
  39.        In single user mode, /sbin/sulogin is invoked on /dev/console.
  40.  
  41.        When entering single user mode, init initializes the consoles stty settings to sane values. Clocal mode is set. Hardware speed and handshaking are not changed.
  42.  
  43.        When  entering  a  multi-user mode for the first time, init performs the boot and bootwait entries to allow file systems to be mounted before users can log in.  Then all entries matching the runlevel
  44.        are processed.
  45.  
  46.        When starting a new process, init first checks whether the file /etc/initscript exists. If it does, it uses this script to start the process.
  47.  
  48.        Each time a child terminates, init records the fact and the reason it died in /var/run/utmp and /var/log/wtmp, provided that these files exist.
  49.  
  50. CHANGING RUNLEVELS
  51.        After it has spawned all of the processes specified, init waits for one of its descendant processes to die, a powerfail signal, or until it is signaled by telinit to  change  the  system's  runlevel.
  52.        When  one  of the above three conditions occurs, it re-examines the /etc/inittab file.  New entries can be added to this file at any time.  However, init still waits for one of the above three condi‐
  53.        tions to occur.  To provide for an instantaneous response, the telinit Q or q command can wake up init to re-examine the /etc/inittab file.
  54.  
  55.        If init is not in single user mode and receives a powerfail signal (SIGPWR), it reads the file /etc/powerstatus. It then starts a command based on the contents of this file:
  56.  
  57.        F(AIL) Power is failing, UPS is providing the power. Execute the powerwait and powerfail entries.
  58.  
  59.        O(K)   The power has been restored, execute the powerokwait entries.
  60.  
  61.        L(OW)  The power is failing and the UPS has a low battery. Execute the powerfailnow entries.
  62.  
  63. ...skipping...
  64.  
  65.        -b, emergency
  66.             Boot directly into a single user shell without running any other startup scripts.
  67.  
  68.        -a, auto
  69.             The  LILO boot loader adds the word "auto" to the command line if it booted the kernel with the default command line (without user intervention).  If this is found init sets the "AUTOBOOT" envi‐
  70.             ronment variable to "yes". Note that you cannot use this for any security measures - of course the user could specify "auto" or -a on the command line manually.
  71.  
  72.        -z xxx
  73.             The argument to -z is ignored. You can use this to expand the command line a bit, so that it takes some more space on the stack. Init can then manipulate the command line so that ps(1) shows the
  74.             current runlevel.
  75.  
  76. INTERFACE
  77.        Init  listens on a fifo in /run, /run/initctl, for messages.  Telinit uses this to communicate with init. The interface is not very well documented or finished. Those interested should study the ini‐
  78.        treq.h file in the src/ subdirectory of the init source code tar archive.
  79.  
  80. SIGNALS
  81.        Init reacts to several signals:
  82.  
  83.        SIGHUP
  84.             Has the same effect as telinit q.
  85.  
  86.        SIGUSR1
  87.             On receipt of this signals, init closes and re-opens its control fifo, /run/initctl.
  88.  
  89.        SIGINT
  90.             Normally the kernel sends this signal to init when CTRL-ALT-DEL is pressed. It activates the ctrlaltdel action.
  91.  
  92.        SIGWINCH
  93.             The kernel sends this signal when the KeyboardSignal key is hit.  It activates the kbrequest action.
  94.  
  95. CONFORMING TO
  96.        Init is compatible with the System V init. It works closely together with the scripts in the directories /etc/init.d and /etc/rc{runlevel}.d.  If your system uses this convention, there should  be  a
  97.        README file in the directory /etc/init.d explaining how these scripts work.
  98.  
  99. FILES
  100.        /etc/inittab
  101.        /etc/initscript
  102.        /dev/console
  103.        /var/run/utmp
  104.        /var/log/wtmp
  105.        /run/initctl
  106.  
  107. WARNINGS
  108.        Init assumes that processes and descendants of processes remain in the same process group which was originally created for them.  If the processes change their group, init can't kill them and you may
  109.        end up with two processes reading from one terminal line.
  110.  
  111.        On a Debian system, entering runlevel 1 causes all processes to be killed except for kernel threads and the script that does the killing and other processes in its session.  As a consequence of this,
  112.        it isn't safe to return from runlevel 1 to a multi-user runlevel: daemons that were started in runlevel S and are needed for normal operation are no longer running.  The system should be rebooted.
  113.  
  114. DIAGNOSTICS
  115.        If  init  finds  that it is continuously respawning an entry more than 10 times in 2 minutes, it will assume that there is an error in the command string, generate an error message on the system con‐
  116.        sole, and refuse to respawn this entry until either 5 minutes has elapsed or it receives a signal.  This prevents it from eating up system resources when someone makes a typographical  error  in  the
  117.        /etc/inittab file or the program for the entry is removed.
  118.  
  119. AUTHOR
  120.        Miquel van Smoorenburg (miquels@cistron.nl), initial manual page by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de).
  121.  
  122. SEE ALSO
  123.        getty(1), login(1), sh(1), runlevel(8), shutdown(8), kill(1), inittab(5), initscript(5), utmp(5)
  124.  
  125.                                                                                                   29 Jul 2004                                                                                          INIT(8)

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN