我创建了一个用户 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 中。谁能告诉我我在这里缺少什么吗?