'\" -*- coding: UTF-8 -*- .\" Copyright (C) 1998-2004 Miquel van Smoorenburg. .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA .\" .\"{{{}}} .\"{{{ Title .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH INIT 8 "29 de julio de 2004" "sysvinit " "Manual del Administrador del Sistema Linux" .\"}}} .\"{{{ Name .SH NOMBRE .\"}}} .\"{{{ Synopsis init, telinit \- control de inicialización de procesos .SH SINOPSIS \fB/sbin/init\fP [\fB \-a \fP] [\fB \-s \fP] [\fB \-b \fP] [ \fB\-z\fP \fIxxx\fP ] [\fB 0123456Ss \fP] .br \fB/sbin/init\fP [\fB \-\-version \fP] .br \fB/sbin/telinit\fP [ \fB\-t\fP \fISEGUNDOS\fP ] [\fB 0123456sSQqabcUu \fP] .br .\"}}} .\"{{{ Description \fB/sbin/telinit\fP [ \fB\-e\fP \fIVAR\fP[\fB=\fP\fIVAL\fP] ] .SH DESCRIPCIÓN .\"{{{ init .SS Init \fBInit\fP es el padre de todos los procesos. Su papel primario es crear procesos a partir de un guión guardado en el fichero \fI/etc/inittab\fP (véase \fBinittab\fP(5)). Este fichero normalmente tiene entradas que harán que se levante \fBgetty\fPs en cada línea en que los usuarios puedan conectarse. También controla procesos autónomos requeridos por un sistema particular. .PP .\"{{{ Runlevels .SH "NIVELES DE EJECUCIÓN (RUNLEVELS)" Un \fInivel de ejecución\fP es una configuración de software del sistema que permite existir solo a un grupo de procesos seleccionado. Los procesos levantados por \fBinit\fP para cada uno de estos niveles de ejecución se definen en el fichero \fI/etc/inittab\fP. \fBInit\fP puede estar en uno de los ocho niveles de ejecución: \fB0\(en6\fP y \fBS\fP o \fBs\fP. El cambio de nivel de ejecución se hace mediante un usuario con privilegio que ejecute \fBtelinit\fP, que envía las señales apropiadas a \fBinit\fP, diciéndole a qué nivel de ejecuación tiene que cambiar. .PP Runlevels \fBS\fP, \fB0\fP, \fB1\fP, and \fB6\fP 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 entering \*(lqsingle\-user mode\*(rq, after which the current runlevel is S. Runlevel 0 is used to halt the system; runlevel 6 is used to reboot the system. .PP 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. Normally after entering single\-user mode the administrator performs maintenance and then reboots the system. .PP For more information, see the manpages for \fBshutdown\fP(8) and \fBinittab\fP(5). .PP Los niveles 7\-9 también son válidos, aunque realmente no están documantados. Esto es porque las variantes Unix tradicionales no los usan. .PP .\"}}} Runlevels \fIS\fP and \fIs\fP are the same. Internally they are aliases for the same runlevel. .PP .SH CARGA Tras llamar a \fBinit\fP como el último paso de la secuencia de carga del núcleo, busca el fichero \fI/etc/inittab\fP para ver si hay una entrada del tipo \fBinitdefault\fP (véase \fBinittab\fP(5)). La entrada \fBinitdefault\fP determina el nivel de ejecución inicial del sistema. Si no está esa entrada (o no existe \fI/etc/inittab\fP), se debe introducir un nivel de ejecución en la consola del sistema. .PP Runlevel \fBS\fP or \fBs\fP initialize the system and do not require an \fI/etc/inittab\fP file. .PP In single user mode, \fB/sbin/sulogin\fP is invoked on \fI/dev/console\fP. .PP When entering single user mode, \fBinit\fP initializes the consoles \fBstty\fP settings to sane values. Clocal mode is set. Hardware speed and handshaking are not changed. .PP Cuando se entra por primera vez en un modo multiusuario, \fBinit\fP realiza las entradas \fBboot\fP y \fBbootwait\fP para permitir que se monten los sistemas de ficheros antes de que los usuarios se presenten al sistema. Entonces se procesan todas las entradas para este nivel. .PP Cuando inicia un nuevo proceso, \fBinit\fP primero verifica si existe el fichero \fI/etc/initscript\fP. Si existe, usa este script para iniciar el proceso. .PP Cada vez que un hijo termina, \fBinit\fP registra el hecho y la razón de su muerte en \fI/var/run/utmp\fP y \fI/var/log/wtmp\fP, suponiendo que estos ficheros existen. .SH "CAMBIO DE NIVEL DE EJECUCIÓN" Tras haber lanzado todos los procesos especificados, \fBinit\fP espera a que alguno de sus procesos descendientes muera, una señal de fallo de alimentación o hsata que se le indique por \fBtelinit\fP que cambie el nivel de ejecución del sisema. Cuando alguna de las tres condiciones anteriores ocurre, re\-examina el fichero \fI/etc/inittab\fP. Se pueden añadir nuevas entradas a este fichero en cualquier momento. Sin embargo, \fBinit\fP aun espera a que alguna de las tres condiciones anteriores suceda. Para proporcionar un respuesta inmediata, \fBtelinit Q\fP o el mandato \fBq\fP puede levantar \fBinit\fP para que re\-examine el fichero \fI/etc/inittab\fP. .PP If \fBinit\fP is not in single user mode and receives a powerfail signal (SIGPWR), it reads the file \fI/etc/powerstatus\fP. It then starts a command based on the contents of this file: .IP F(AIL) Power is failing, UPS is providing the power. Execute the \fBpowerwait\fP and \fBpowerfail\fP entries. .IP O(K) The power has been restored, execute the \fBpowerokwait\fP entries. .IP L(OW) The power is failing and the UPS has a low battery. Execute the \fBpowerfailnow\fP entries. .PP If \fI/etc/powerstatus\fP doesn't exist or contains anything else then the letters \fBF\fP, \fBO\fP or \fBL\fP, \fBinit\fP will behave as if it has read the letter \fBF\fP. .PP Usage of \fBSIGPWR\fP and \fI/etc/powerstatus\fP is discouraged. Someone wanting to interact with \fBinit\fP should use the \fI/run/initctl\fP control channel \- see the \fBinitctl\fP(5) manual page for more documentation about this. .PP .\"}}} .\"{{{ telinit Cuando se lesolicita a \fBinit\fP que cambie el nivel, envía la señal de aviso \fBSIGTERM\fP a todos los procesos que no están definidos en el nuevo nivel de ejecución. Espera 3 segundos antes de forzar la terminación de estos procesos mediante la señal \fBSIGKILL\fP. Observe que \fBinit\fP supone que todos estos procesos (y sus descendientes) permanecen en el mismo grupo de procesos que \fBinit\fP creó originalmente para ellos. Si cualquier proceso cambia la afiliación de grupo de proceso no recibirá estas señales. Tales procesos necesitan ser terminados de forma separada. .SH TELINIT \fB/sbin/telinit\fP está enlazado con \fB/sbin/init\fP. Toma un argumento de un solo carácter y señala a \fBinit\fP para realizar la acción apropiada. Los siguientes argumetos sirven como directivas para \fBtelinit\fP: .IP "\fB0\fP, \fB1\fP, \fB2\fP, \fB3\fP, \fB4\fP, \fB5\fP or \fB6\fP" indica a \fBinit\fP que cambie al nivel de ejecución especificado. .IP "\fBa\fP, \fBb\fP, \fBc\fP" tell \fBinit\fP to process only those \fB/etc/inittab\fP file entries having runlevel \fBa\fP, \fBb\fP or \fBc\fP. .IP "\fBQ\fP o \fBq\fP" indica a \fBinit\fP que re\-examine el fichero \fI/etc/inittab\fP. .IP "\fBS\fP o \fBs\fP" indica a \fBinit\fP que cambie a modo monousuario. .IP "\fBU\fP o \fBu\fP" indica a \fBinit\fP que reejecute él mismo (guardando el estado). No re\-examining el fichero \fI/etc/inittab\fP. El nivel de ejecución debería ser uno de \fBSs0123456\fP, en otro caso la solicitud sería ignorada silenciosamente. .PP \fBtelinit\fP ptambién puede decir a \fBinit\fP cuanto esperará entre los envíos a los procesos de las señales \fBSIGTERM\fP y \fBSIGKILL\fP. El valor por defecto es is 3 segundos, pero se puede cambiar con la opción \fB\-t\fP. .PP \fBtelinit \-e\fP tells \fBinit\fP to change the environment for processes it spawns. The argument of \fB\-e\fP is either of the form \fIVAR\fP=\fIVAL\fP which sets variable \fIVAR\fP to value \fIVAL\fP, or of the form \fIVAR\fP (without an equality sign) which unsets variable \fIVAR\fP. .PP \fBtelinit\fP solo se puede llamar por usuarios con los privilegios apropiados. .PP .\"}}} .\"}}} El binario \fBinit\fP comprueba si es \fBinit\fP o \fBtelinit\fP mirando a su \fIid de proceso\fP; el id del proceso \fBinit\fP real es siempre \fB1\fP. De esto podemos concluir que en lugar de llamar a \fBtelinit\fP se puede usar \fBinit\fP en su lugar como abreviatura. .SH ENTORNO \fBInit\fP fija las siguientes variables de entorno para todos sus hijos: .IP \fBPATH\fP \fI/bin:/usr/bin:/sbin:/usr/sbin\fP .IP \fBINIT_VERSION\fP Como el nombre dice. Útil para determinar si un guión corre directamente de \fBinit\fP. .IP \fBRUNLEVEL\fP El nivel actual de ejecución del sistema. .IP \fBPREVLEVEL\fP El nivel de ejecución previo (útil tras un cambio de nivel). .IP \fBCONSOLE\fP La consola del sistema. Esto realmente es heredado del núcleo; sin embargo si no está fijado \fBinit\fP lo pondrá como \fI/dev/console\fP por defecto. .SH "BANDERAS DE CARGA" Es posible pasar un número de banderas a \fBinit\fP desde el monitor de arranque (v.g. LILO o GRUB). \fBinit\fP acepta las siguientes banderas: .TP 0.5i \fB\-s, S, single\fP Arranque en modo monousuario. En este modo \fI/etc/inittab\fP se examina y los guiones de carga rc normalmente se ejecutan antes de que la shell del modo monousuario se inicie. .PP .TP 0.5i \fB1\-5\fP Nivel de ejecución en el que arrancar. .PP .TP 0.5i \fB\-b, emergency\fP Carga directamente en una shell monousuario sin ejecutar cualquier otro guion de inicio. .PP .TP 0.5i \fB\-a, auto\fP 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 \fBinit\fP sets the "AUTOBOOT" environment variable to "yes". Note that you cannot use this for any security measures \- of course the user could specify "auto" or \fB\-a\fP on the command line manually. .PP .TP 0.5i \fB\-z \fP\fIxxx\fP The argument to \fB\-z\fP is ignored. You can use this to expand the command line a bit, so that it takes some more space on the stack. \fBinit\fP can then manipulate the command line so that \fBps\fP(1) shows the current runlevel. .PP .TP 0.5i \fB\-\-version\fP This argument, when used on its own, displays the current version of \fBinit\fP to the console/stdout. It is a quick way to determine which \fBinit\fP software and version is being used. After the version information is displayed, \fBinit\fP immediately exits with a return code of zero. .PP .SH INTERFAZ \fBinit\fP escucha en un \fIfifo\fP en /dev, \fI/run/initctl\fP, los mensajes. \fBTelinit\fP usa esto para comunicar con \fBinit\fP. La interfaz no está muy bien documentada o acabada. Quienes estén interesados debería estudiar el fichero \fIinitreq.h\fP del subdirectorio \fIsrc/\fP del código fuente de \fBinit\fP. .SH SEÑALES Init reacciona ante diversas señales: .TP 0.5i \fBSIGHUP\fP Has the same effect as \fBtelinit q\fP. .PP .TP 0.5i \fBSIGUSR1\fP Al recibir esta señal, \fBinit\fP cierra y reabre su fifo de de control \fB/run/initctl\fP. Ess útil para los guiones de arranque cuando se vuelve a montar \fI/dev\fP. .TP 0.5i \fBSIGUSR2\fP When \fBinit\fP receives \fBSIGUSR2\fP, \fBinit\fP closes and leaves the control fifo, \fB/run/initctl\fP, closed. This may be used to make sure \fBinit\fP is not holding open any files. However, it also prevents \fBinit\fP from switching runlevels. Which means commands like shutdown no longer work. The fifo can be re\-opened by sending \fBinit\fP the \fBSIGUSR1\fP signal. .TP 0.5i \fBSIGINT\fP Normalmente el núcleo envía esta señal a \fBinit\fP cuando se pulsa CTRL\-ALT\-SUPR. Esto activa la acción \fIctrlaltdel\fP. .TP 0.5i \fBSIGWINCH\fP El núcleo envía esta señal cuado se pulsa la tecla \fIKeyboardSignal\fP. Activa la acción \fIkbrequest\fP. .\"{{{ Conforming to .SH "CONFORME A" .\"}}} .\"{{{ Files \fBinit\fP es compatible con el init System V init. Funciona junto a los guiones de lso directorios \fI/etc/init.d\fP y \fI/etc/rc{runlevel}.d\fP. Si su sistema usa esta convención, debería haber un fichero \fIREADME\fP en el directorio \fI/etc/init.d\fP que explica como funcionan estos guiones. .SH ARCHIVOS .nf /etc/inittab /etc/initscript /dev/console /var/run/utmp /var/log/wtmp /run/initctl .fi .\"}}} .\"{{{ Warnings .SH AVISOS \fBinit\fP supone que procesos y descendientes de procesos permanecen en el mismo grupo de procesos que se creó originalmente para ellos. Si los procesos cambian su grupo \fBinit\fP no puede matarlos y v.d. puede acabar con dos procesos leyendo de una línea del terminal. .PP .\"}}} .\"{{{ Diagnostics 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, 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. .SH DIAGNÓSTICOS .\"}}} .\"{{{ Author Si \fBinit\fP encuantra que está levantando continuamente una entrada, más de 10 veces en dos minutos, supondrá que es un error en la cedena del mandato, genera un mensaje de error en la consola del sistema y rehusa levantar esta entrada hasta que hayan pasado 5 minutos o recibas una señal. Esto no previene de que se coma los recursos del sistema cuando alguien comete un error tipográfico en el fichero \fI/etc/inittab\fP o en el programa para el que se elimina la entrada. .SH AUTOR .\"}}} .\"{{{ See also .MT miquels@\:cistron\:.nl Miquel van Smoorenburg .ME , página de manual inicial por .MT u31b3hs@\:pool\:.informatik\:.rwth\-aachen\:.de Michael Haardt .ME . .SH "VÉASE TAMBIÉN" \fBgetty\fP(1), \fBlogin\fP(1), \fBsh\fP(1), \fBrunlevel\fP(8), \fBshutdown\fP(8), \fBkill\fP(1), \fBinitctl\fP(5), \fBinittab\fP(5), \fBinitscript\fP(5), \fButmp\fP(5) .\"}}}