¿Qué hace "systemctl daemon-reload"?


47

Tengo un servicio que se detuvo de repente. Traté de reiniciar ese servicio pero fallé y solicité ejecutar "systemctl daemon-reload".

¿Qué hace exactamente? ¿Qué es una "recarga de demonio"?

Respuestas:


47

man systemctl dice:

   daemon-reload
       Reload systemd manager configuration. This will rerun all generators (see systemd.generator(7)), reload
       all unit files, and recreate the entire dependency tree. While the daemon is being reloaded, all sockets
       systemd listens on behalf of user configuration will stay accessible.

       This command should not be confused with the reload command.

Entonces, es una recarga "suave", esencialmente; tomando configuraciones cambiadas del sistema de archivos y regenerando árboles de dependencia .

En consecuencia, systemd.generatorafirma:

Los generadores son pequeños binarios que viven en / usr / lib / systemd / user-generators / y otros directorios mencionados anteriormente. systemd (1) ejecutará esos archivos binarios muy temprano en el arranque y en el tiempo de recarga de la configuración, antes de cargar los archivos de la unidad. Los generadores pueden generar dinámicamente archivos unitarios o crear enlaces simbólicos a archivos unitarios para agregar dependencias adicionales, extendiendo o anulando las definiciones existentes. Su propósito principal es convertir dinámicamente archivos de configuración que no son archivos unitarios nativos en archivos unitarios nativos.

   Generators are loaded from a set of paths determined during compilation, listed above. System and user
   generators are loaded from directories with names ending in system-generators/ and user-generators/,
   respectively. Generators found in directories listed earlier override the ones with the same name in
   directories lower in the list. A symlink to /dev/null or an empty file can be used to mask a generator,
   thereby preventing it from running. Please note that the order of the two directories with the highest
   priority is reversed with respect to the unit load path and generators in /run overwrite those in /etc.

   After installing new generators or updating the configuration, systemctl daemon-reload may be executed. This
   will delete the previous configuration created by generators, re-run all generators, and cause systemd to
   reload units from disk. See systemctl(1) for more information.
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.