如何避免 systemctl status 中的 ExecStop 狀態

如何避免 systemctl status 中的 ExecStop 狀態

systemctl status 指令顯示 ExecStop Failure 訊息。即使我的服務已啟動並正在運行。

testDB.service - the testDB service
  Loaded: loaded (/usr/lib/systemd/system/testDB.service; enabled; vendor preset: disabled)
  Active: active (running) since Wed 2022-04-27 15:55:38 IST; 7s ago
 Process: 946 ExecStop=db/testDB/scripts/testDB.init stop (code=exited, status=1/FAILURE)
 Process: 995 ExecStart=db/testDB/scripts/testDB.init start (code=exited, status=0/SUCCESS)

有什麼辦法可以避免 ExecStop FAILURE 訊息嗎?

答案1

ExecStop刪除從您的服務的 systemd 單元檔案開始的行。或確保腳本testDB.init stop始終返回退出代碼 0

相關內容