jueves, 26 de noviembre de 2015

Niveles de ejecución o RUN LEVELS

Los niveles de ejecución hacen referencia a los modos en los cuales el sistema operativo puede operar desde que ha sido encendido.

En las versiones de RHEL, CentOS, Fedora, y las demas distros los run levels son los siguientes:


Run Level Nombre Descripción
0 Apagado Procede apagar el sistema operativo
1 Monousuario En este modo solo se habilita el acceso al usuario root no se habilita el acceso de la red
2 Multiusuario En este modo se habilita el acceso a mas usuarios pero no se habilita la red
3 Multiusuario Se habilita la interfaz de red
4 Multiusuario con red Igual que el modo 3
5 Modo Grafico Permite iniciar el sistema operativo con una interfaz de red
6 Reinicio Procede a reiniciar el sistema operativo

Para consultar el run level de un sistema operativo lo haremos con el siguiente comando:

# runlevel

Para cambiar el run level de un sistema operativo lo haremos modificando el siguiente parámetro.

# vim /etc/inittab

Tendremos un contenido similar al siguiente:

# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:

Para modificar el run level se debe de cambiar el valor descrito en este archivo en la línea des-comentada.

Run levels con systemd
A partir de la versión de RHEL7 los sistemas operativos ya no son manejados por el super demonio initd por lo cual el manejo de los run levels es distinto, en estas nuevas versiones el super demonio es el systemd. Para manejar los run leves se lo hace con el systemctl

Para ver en que nivel esta corriendo el sistema operativo

# systemclt get-default
graphical.target

Como se puede ver ya no se muestra los valores que habíamos identificado anteriormente.

Para ver los niveles de servicio del sistema operativo se lo realiza con el siguiente comando:


[root@dark ~]# systemctl list-units --type=target
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cryptsetup.target loaded active active Encrypted Volumes
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network.target loaded active active Network
nfs-client.target loaded active active NFS client services
nss-lookup.target loaded active active Host and Network Name Lookups
nss-user-lookup.target loaded active active User and Group Name Lookups
paths.target loaded active active Paths
remote-fs-pre.target loaded active active Remote File Systems (Pre)
remote-fs.target loaded active active Remote File Systems
rpcbind.target loaded active active RPC Port Mapper
slices.target loaded active active Slices
sockets.target loaded active active Sockets
sound.target loaded active active Sound Card
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
timers.target loaded active active Timers

LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.

22 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

Para cambiar el nivel de ejecución por defecto utilizaremos el parámetro set-default seguido del “UNIT” asociado

# systemctl set-default  multi-user.target


No hay comentarios:

Publicar un comentario