Linux

嘗試完全重新安裝 icinga2 後“超出配置的資源限制”

  • February 14, 2022

我試圖通過執行apt-get purge --auto-remove icinga2並刪除與 icinga2 相關的任何內容,從我的 Ubuntu Server 16.04 中完全刪除 icinga2locate icinga2

我的第二步結果相當愚蠢,因為無論我做什麼,我似乎都無法正確重新安裝 icinga2。我注意到,重新安裝後該服務仍然失去(什麼都沒有/etc/init.d/

我剛剛從另一台主機複製了文件,現在,當我嘗試啟動 icinga2 時,我得到:

Job for icinga2.service failed because a configured resource limit was exceeded. See "systemctl status icinga2.service" and "journalctl -xe" for details.

systemctl status icinga2.service顯示:

   ● icinga2.service - Icinga host/service/network monitoring system
  Loaded: loaded (/lib/systemd/system/icinga2.service; disabled; vendor preset: enabled)
  Active: failed (Result: resources)

Jul 23 20:53:41 srvweb systemd[1]: icinga2.service: Failed to load environment files: No such file or directory
Jul 23 20:53:41 srvweb systemd[1]: icinga2.service: Failed to run 'start-pre' task: No such file or directory
Jul 23 20:53:41 srvweb systemd[1]: Failed to start Icinga host/service/network monitoring system.
Jul 23 20:53:41 srvweb systemd[1]: icinga2.service: Failed with result 'resources'.
Jul 23 20:55:25 srvweb systemd[1]: Stopped Icinga host/service/network monitoring system.
Jul 24 21:44:02 srvweb systemd[1]: Stopped Icinga host/service/network monitoring system.
Jul 24 21:44:02 srvweb systemd[1]: icinga2.service: Failed to load environment files: No such file or directory
Jul 24 21:44:02 srvweb systemd[1]: icinga2.service: Failed to run 'start-pre' task: No such file or directory
Jul 24 21:44:02 srvweb systemd[1]: Failed to start Icinga host/service/network monitoring system.
Jul 24 21:44:02 srvweb systemd[1]: icinga2.service: Failed with result 'resources'.

journalctl -xe顯示相同。

不應該有辦法解決這個問題嗎?請幫助我從錯誤中吸取教訓。提前非常感謝:)

編輯:

更多資訊:

cat /lib/systemd/system/icinga2.service
[Unit]
Description=Icinga host/service/network monitoring system
After=postgresql.service mariadb.service carbon-cache.service mysql.service syslog.target network.target

[Service]
Type=simple
UMask=0007
EnvironmentFile=/usr/lib/icinga2/icinga2
EnvironmentFile=/etc/default/icinga2
ExecStartPre=/usr/lib/icinga2/prepare-dirs /usr/lib/icinga2/icinga2
ExecStart=/usr/sbin/icinga2 daemon -e ${ICINGA2_ERROR_LOG}
ExecReload=/usr/lib/icinga2/safe-reload /usr/lib/icinga2/icinga2
PIDFile=/run/icinga2/icinga2.pid

[Install]
WantedBy=multi-user.target

/etc/default/icinga2不存在。在我的其他主機上,文件看起來完全一樣,並且路徑確實存在,所以我假設它需要存在。

看起來你失去了很多文件。可能您沒有從您的文件中刪除所有 icinga 使用的包apt-get purge,然後當您手動刪除文件時,您留下了損壞的包。

Failed to load environment files是 SystemD icinga 單元文件中的參考。找到它(在/etc/systemd/system或下/lib/systemd/system)並查看它是否有EnvironmentFile設置並且該文件存在。如果它不存在,您需要確定它屬於哪個包(使用dpkg -S <file>)並執行apt-get install --reinstall <package>.

我也遇到了同樣的錯誤,但是在我重新啟動機器後它就消失了。

引用自:https://unix.stackexchange.com/questions/381602