用戶 systemd 服務在掛起後不會重新啟動

用戶 systemd 服務在掛起後不會重新啟動

我建立了一個使用者 systemd 服務,以便在暫停後重新啟動 Spotify,正如 Spotify git Hub 頁面中所建議的那樣。我遇到的問題是它在掛起後永遠不會重新啟動。

這是restartSpotifyd 服務文件。我已經刪除了

重新啟動=始終

從 restartSpotifyd.service 檔案中,因為我達到了開始限制('start-limit-hit')。這是服務文件的更新版本:

.config/systemd/user/restartSpotifyd.service

[Unit]
Description=Restart spotifyd after resume
After=suspend.target

[Service]
Type=simple
ExecStart=/bin/systemctl --user --no-block restart spotifyd.service

[Install]
WantedBy=suspend.target

當我暫停並重新啟動電腦時,我得到以下資訊:

systemctl --user status restartSpotifyd
● restartSpotifyd.service - Restart spotifyd after resume
     Loaded: loaded (/home/netlak/.config/systemd/user/restartSpotifyd.service; enabled; vendor preset: enabled)
     Active: inactive (dead)

May 26 15:04:13 jamming systemd[1361]: Stopped Restart spotifyd after resume.
May 26 15:04:13 jamming systemd[1361]: Started Restart spotifyd after resume.
May 26 15:04:13 jamming systemd[1361]: restartSpotifyd.service: Succeeded.
May 26 15:04:13 jamming systemd[1361]: restartSpotifyd.service: Scheduled restart job, restart counter is at 5.
May 26 15:04:13 jamming systemd[1361]: Stopped Restart spotifyd after resume.
May 26 15:04:13 jamming systemd[1361]: restartSpotifyd.service: Start request repeated too quickly.
May 26 15:04:13 jamming systemd[1361]: restartSpotifyd.service: Failed with result 'start-limit-hit'.
May 26 15:04:13 jamming systemd[1361]: Failed to start Restart spotifyd after resume.
May 26 15:06:21 jamming systemd[1361]: Started Restart spotifyd after resume.
May 26 15:06:21 jamming systemd[1361]: restartSpotifyd.service: Succeeded.

15:10我暫停了電腦但是醒來時服務還沒重新啟動。上次重啟是我在15:06手動重啟服務的時候。

這種情況發生在 Debian 和 Archlinux 中。誰能告訴我我在這裡缺少什麼嗎?

相關內容