O que faz o “systemctl daemon-reload”?

28

Eu tenho um serviço que parou de repente. Eu tentei reiniciar esse serviço, mas falhei e pediu para executar o "systemctl daemon-reload".

O que exatamente faz? O que é um "daemon reload?"

    
por John 13.05.2017 / 04:49

1 resposta

22

man systemctl diz:

   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.

Portanto, é uma recarga "soft", essencialmente; levando configurações alteradas do sistema de arquivos e regenerando árvores de dependência .

Consequentemente, systemd.generator declara:

Generators are small binaries that live in /usr/lib/systemd/user-generators/ and other directories listed above. systemd(1) will execute those binaries very early at bootup and at configuration reload time — before unit files are loaded. Generators can dynamically generate unit files or create symbolic links to unit files to add additional dependencies, thus extending or overriding existing definitions. Their main purpose is to convert configuration files that are not native unit files dynamically into native unit files.

   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.
    
por 13.05.2017 / 06:35