GNU/Linux >> Tutoriales Linux >  >> Linux

Servicio de sistema operativo Linux 'xendomains'

El servicio xendomains inicia, detiene y migra automáticamente los clientes de Oracle VM (domU) cuando el servidor de Oracle VM (dom0) se inicia o se apaga. En esencia, el servicio xendomains emite automáticamente una serie de comandos xm para garantizar que se inicien y detengan los clientes Oracle VM adecuados cuando se inicia o detiene el servidor dom0. El servicio xendomains no controla demonios ni otros procesos en segundo plano; solo máquinas virtuales cliente dom0.

Como parte del producto Oracle VM Server, el servicio xendomains se proporciona como parte del paquete RPM de xen-tools y normalmente se instala como parte del producto Oracle VM Server.

Durante el inicio del sistema dom0, se inicia el servicio xend (descrito en otra parte). Poco después se ejecuta el servicio xendomains. Cualquier cliente domU cuyo estado haya sido guardado por un apagado anterior se inicia con el script /etc/init.d/xendomains. Luego, también se inician todos los clientes domU marcados para el inicio automático. Una vez hecho esto, el servicio xendomains finaliza.

Para evitar intentos de ejecutar

# service xendomains start

comando varias veces y, por lo tanto, potencialmente ejecutar varias instancias de los clientes domU, el script xendomains mantiene el archivo de bloqueo /var/lock/subsys/xendomains, como es práctica común entre los servicios de Linux. Si existe este archivo de bloqueo, el servicio no se puede iniciar de nuevo; si no se iniciaron clientes virtuales, este archivo de bloqueo no se crea.

Durante el apagado del sistema dom0, antes de que finalice el servicio xend, el servicio xendomains se ejecuta nuevamente para tratar con cualquier cliente domU que aún se esté ejecutando. El cierre del cliente se divide en varios pasos:

Escenario ¿Requerido? Descripción
Seleccionar Gestionar todos los dominios domU o solo los marcados como AUTO
SysRQ Opcional Los dominios de cliente se pueden controlar opcionalmente mediante la ejecución de pulsaciones de teclas mágicas Alt-SysRQ en la máquina virtual.
Migrar Opcional Los dominios de cliente que aún se ejecutan después de presionar las teclas Alt-SysRQ se pueden migrar a otro host dom0 en ejecución mediante el comando "xm migrate".
Guardar Opcional Emita un comando "xm save" para cualquier dominio de cliente que aún se esté ejecutando localmente después del paso de migración.
Apagar Emita el comando "xm shutdown" para finalizar correctamente cualquier cliente virtual que aún se esté ejecutando localmente.
Limpieza Eliminar el archivo de bloqueo del servicio.

Naturaleza

Este es un servicio que se ejecuta una vez al iniciar el sistema para iniciar las máquinas cliente Oracle VM seleccionadas y una vez antes del apagado del sistema para migrar, guardar o apagar todas las máquinas cliente Oracle VM en ejecución.

Control de servicios

Para ejecutar automáticamente el servicio xendomains en el próximo arranque del sistema, use el comando:

# chkconfig xendomains on
# chkconfig --list xendomains
xendomains   0:off  1:off  2:off  3:on   4:on   5:on   6:off

Para invocar manualmente el servicio xendomains, use el comando:

# service xendomains help
Usage: /etc/init.d/xendomains  {start|stop|restart|reload|status}

Los detalles de cada función se resumen a continuación:

Comando Descripción
inicio Restaura cualquier cliente domU guardado. Iniciar clientes domU marcados como AUTO.
detener Apague cualquier máquina virtual cliente en ejecución, utilizando los métodos descritos anteriormente.
reiniciar Equivalente a una secuencia de parada/inicio.
recargar Equivalente al comando reiniciar .
estado Muestre una lista de los dominios de clientes virtuales actualmente en ejecución. Si no hay ninguno, devuelve el código de salida 3.

Configuración

El comportamiento del servicio xendomains está controlado por el archivo /etc/sysconfig/xendomains. Este archivo bien comentado controla cómo el servicio administra los clientes domU. A continuación se muestra un archivo de configuración de muestra:

## Path: System/xen
## Description: xen domain start/stop on boot
## Type: string
## Default: 
#
# The xendomains script can send SysRq requests to domains on shutdown.
# If you don't want to MIGRATE, SAVE, or SHUTDOWN, this may be a possibility
# to do a quick and dirty shutdown ("s e i u o") or at least sync the disks
# of the domains ("s").
#
XENDOMAINS_SYSRQ=""

## Type: integer 
## Default: 100000
#
# If XENDOMAINS_SYSRQ is set, this variable determines how long to wait
# (in microseconds) after each SysRq, so the domain has a chance to react.
# If you want to a quick'n'dirty shutdown via SysRq, you may want to set
# it to a relatively high value (1200000).
#
XENDOMAINS_USLEEP=100000

## Type: integer
## Default: 5000000
#
# When creating a guest domain, it is sensible to allow a little time for it
# to get started before creating another domain or proceeding through the
# boot process. Without this, the booting guests will thrash the disk as they
# start up. This timeout (in microseconds) specifies the delay after guest
# domain creation.
#
XENDOMAINS_CREATE_USLEEP=5000000

## Type: string
## Default: ""
#
# Set this to a non-empty string if you want to migrate virtual machines
# on shutdown. The string will be passed to the xm migrate DOMID command
# as is: It should contain the target IP address of the physical machine
# to migrate to and optionally parameters like --live. Leave empty if
# you don't want to try virtual machine relocation on shutdown.
# If migration succeeds, neither SAVE nor SHUTDOWN will be executed for
# that domain.
#
XENDOMAINS_MIGRATE=""

## Type: string
## Default: /var/lib/xen/save
#
# Directory to save running domains to when the system (dom0) is
# shut down. Will also be used to restore domains from if # XENDOMAINS_RESTORE
# is set (see below). Leave empty to disable domain saving on shutdown 
# (e.g. because you rather shut domains down).
# If domain saving does succeed, SHUTDOWN will not be executed.
#
XENDOMAINS_SAVE=/var/lib/xen/save

## Type: string
## Default: "--halt --wait"
#
# If neither MIGRATE nor SAVE were enabled or if they failed, you can
# try to shut down a domain by sending it a shutdown request. To do this,
# set this to "--halt --wait". Omit the "--wait" flag to avoid waiting
# for the domain to be really down. Leave empty to skip domain shutdown.
#
XENDOMAINS_SHUTDOWN="--halt --wait"

## Type: string
## Default: "--all --halt --wait"
#
# After we have gone over all virtual machines (resp. all automatically
# started ones, see XENDOMAINS_AUTO_ONLY below) in a loop and sent SysRq,
# migrated, saved and/or shutdown according to the settings above, we
# might want to shutdown the virtual machines that are still running
# for some reason or another. To do this, set this variable to
# "--all --halt --wait", it will be passed to xm shutdown.
# Leave it empty not to do anything special here.
# (Note: This will hit all virtual machines, even if XENDOMAINS_AUTO_ONLY
# is set.)
# 
XENDOMAINS_SHUTDOWN_ALL="--all --halt --wait"

## Type: boolean
## Default: true
#
# This variable determines whether saved domains from XENDOMAINS_SAVE
# will be restored on system startup. 
#
XENDOMAINS_RESTORE=true

## Type: string
## Default: /etc/xen/auto
#
# This variable sets the directory where domains configurations
# are stored that should be started on system startup automatically.
# Leave empty if you don't want to start domains automatically
# (or just don't place any xen domain config files in that dir).
# Note that the script tries to be clever if both RESTORE and AUTO are 
# set: It will first restore saved domains and then only start domains
# in AUTO which are not running yet. 
# Note that the name matching is somewhat fuzzy.
#
XENDOMAINS_AUTO=/etc/xen/auto

## Type: boolean
## Default: false
# 
# If this variable is set to "true", only the domains started via config 
# files in XENDOMAINS_AUTO will be treated according to XENDOMAINS_SYSRQ,
# XENDOMAINS_MIGRATE, XENDOMAINS_SAVE, XENDMAINS_SHUTDOWN; otherwise
# all running domains will be. 
# Note that the name matching is somewhat fuzzy.
# 
XENDOMAINS_AUTO_ONLY=false

## Type: integer
## Default: 300
#
# On xendomains stop, a number of xm commands (xm migrate, save, shutdown,
# shutdown --all) may be executed. In the worst case, these commands may
# stall forever, which will prevent a successful shutdown of the machine.
# If this variable is non-zero, the script will set up a watchdog timer
# for every of these xm commands and time it out after the number of seconds
# specified by this variable.
# Note that SHUTDOWN_ALL will not be called if no virtual machines or only
# zombies are still running, so you don't need to enable this timeout just
# for the zombie case.
# The setting should be large enough to make sure that migrate/save/shutdown
# can succeed. If you do live migrations, keep in mind that live migration
# of a 1GB machine over Gigabit ethernet may actually take something like
# 100s (assuming that live migration uses 10% of the network # bandwidth).
# Depending on the virtual machine, a shutdown may also require a significant
# amount of time. So better setup this variable to a huge number and hope the
# watchdog never fires.
#
XENDOMAINS_STOP_MAXWAIT=300


Linux
  1. Servicio del sistema operativo Linux 'anacron'

  2. Servicio del sistema operativo Linux 'iptables'

  3. Servicio de sistema operativo Linux 'red'

  4. Servicio de sistema operativo Linux 'mapa de puertos'

  5. Servicio de SO Linux 'auditoría'

Servicio de sistema operativo Linux 'NetFS'

Servicio de sistema operativo Linux 'ldap'

Servicio del sistema operativo Linux 'yppasswdd'

Servicio del sistema operativo Linux 'nscd'

Servicio de sistema operativo Linux 'calamar'

Servicio de sistema operativo Linux 'smartd'