Co robi „systemctl daemon-reload”?


46

Mam usługę, która nagle się zatrzymała. Próbowałem zrestartować tę usługę, ale nie powiodło się i poprosiłem o uruchomienie „systemctl daemon-reload”.

Co to dokładnie robi? Co to jest „przeładowanie demona”?

Odpowiedzi:


47

man systemctl mówi:

   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.

Zasadniczo jest to „miękkie” przeładowanie; pobieranie zmienionych konfiguracji z systemu plików i regenerowanie drzew zależności .

W związku z tym systemd.generatorstwierdza:

Generatory to małe pliki binarne, które znajdują się w / usr / lib / systemd / user-generators / i innych katalogach wymienionych powyżej. Systemd (1) uruchomi te pliki binarne bardzo wcześnie podczas uruchamiania i podczas przeładowywania konfiguracji - zanim zostaną załadowane pliki jednostek. Generatory mogą dynamicznie generować pliki jednostek lub tworzyć dowiązania symboliczne do plików jednostek, aby dodać dodatkowe zależności, rozszerzając lub zastępując istniejące definicje. Ich głównym celem jest dynamiczna konwersja plików konfiguracyjnych, które nie są plikami natywnymi, na pliki jednostek natywnych.

   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.
Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.