![用户 systemd 服务在挂起后不会重新启动](https://linux22.com/image/191671/%E7%94%A8%E6%88%B7%20systemd%20%E6%9C%8D%E5%8A%A1%E5%9C%A8%E6%8C%82%E8%B5%B7%E5%90%8E%E4%B8%8D%E4%BC%9A%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8.png)
我创建了一个用户 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 中。谁能告诉我我在这里缺少什么吗?