Изменяет ли файл override.conf фактическую конфигурацию служебного файла?

Вы, скорее всего, испытываете это .

Попробуйте запустить:

dracut --regenerate-all -f && grub2-mkconfig -o /boot/grub2/grub.cfg

Это перестроит initramfsи решит проблемы с именами в блочных устройствах.(/dev/sda1теперь может быть /dev/xvde1или что-то подобное ).

Это спасло меня при переходе с VMWare на OracleVM.

Подробнее о dracut здесь .

0
11.06.2021, 17:43
1 ответ

То, что вы хотите (удаление зависимости от устройства через перетаскивание -в файле )невозможно, в соответствии с справочной страницей systemd.unit :

Dependencies (After=, etc.) cannot be reset to an empty list, so dependencies can only be added in drop-ins. If you want to remove dependencies, you have to override the entire unit.

Переопределение всего юнит-файла можно выполнить, следуя второму примеру на справочной странице:

There are two methods of overriding vendor settings in unit files: copying the unit file from /usr/lib/systemd/system to /etc/systemd/system and modifying the chosen settings. [...] The advantage of the first method is that one easily overrides the complete unit, the vendor unit is not parsed at all anymore. It has the disadvantage that improvements to the unit file by the vendor are not automatically incorporated on updates.

В вашем случае вы должны (быть пользователем root)

  • cp /usr/lib/systemd/system/systemd-journal-catalog-update.service /etc/systemd/system
  • systemctl daemon-reload
  • systemctl restart systemd-journal-catalog-update

После этого systemctl statusбудет указывать на служебный файл в/etc:

# systemctl status systemd-journal-catalog-update
● systemd-journal-catalog-update.service - Rebuild Journal Catalog
     Loaded: loaded (/etc/systemd/system/systemd-journal-catalog-update.service; static)
     Active: active (exited) since Sat 2021-05-22 16:27:07 CEST; 3 weeks 2 days ago
[...]

Вышеупомянутый systemctl catтакже не будет показывать файл в/etc/:

# systemctl cat systemd-journal-catalog-update
# /etc/systemd/system/systemd-journal-catalog-update.service
#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Rebuild Journal Catalog
[...]

Теперь вы можете отредактировать файл в /etcпо своему усмотрению, снова запустить systemctl daemon-reloadи systemctl restart systemd-journal-catalog-updateдля запуска службы с файлом пользовательского модуля и его настройками.

Обратите внимание на следующее, упомянутое на справочной странице:

It has the disadvantage that improvements to the unit file by the vendor are not automatically incorporated on updates.

Так как теперь systemd читает совершенно другой юнит-файл, отличный от того, что находится в пакете systemd вашего дистрибутива, вы должны вручную применять любые обновления из файла в /usr/libк вашей собственной копии..rpmnew(из дистрибутивов на основе RPM -)или.pacnew(из дистрибутивов на основе pacman -)файлы, которые обычно генерируются, если файл конфигурации, отслеживаемый менеджером пакетов, был изменен как локальным администратором, так и в этом случае пакет не будет сгенерирован.

0
28.07.2021, 11:25

Теги

Похожие вопросы