Rhel
RHEL 7.9 上沒有網路管理器服務
有一個 RHEL 7.9 伺服器。似乎已安裝 networkmanger 軟體包但未添加任何服務。有沒有辦法可以手動添加服務?
# yum install NetworkManager Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. local | 2.8 kB 00:00:00 Package 1:NetworkManager-1.18.8-1.el7.x86_64 already installed and latest version Nothing to do # systemctl start networkmanager Failed to start networkmanager.service: Unit not found. # cat /etc/*release NAME="Red Hat Enterprise Linux Server" VERSION="7.9 (Maipo)" ...
嘗試:
systemctl daemon-reload systemctl status NetworkManager # start if it is there systemctl start NetworkManager
如果它不起作用檢查單元文件:
systemctl list-unit-files | grep -i network
如果它不存在檢查
/usr/lib/systemd/system/ /etc/systemd/system
任何 .service 文件的目錄。
如果您需要創建 .service 文件,這裡是一個模板:
[Unit] Description=<description about this service> [Service] User=<user e.g. root> WorkingDirectory=<directory_of_script e.g. /root> ExecStart=<script which needs to be executed> Restart=always [Install] WantedBy=multi-user.target