systemd를 사용하여 정지 시 Clementine 재생을 중지하는 방법

systemd를 사용하여 정지 시 Clementine 재생을 중지하는 방법

일시 중지 모드로 들어가기 전에 Clementine 재생을 중지하기 위해 DBus를 사용하려고 합니다. 이것은 내 현재 서비스 파일입니다.

[Unit]
Description=Stop Clementine playback before suspend
Requires=dbus.service
Before=sleep.target
Before=dbus.service

[Service]
User=jo
Type=oneshot
ExecStart=-/bin/sh -c 'qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Stop'

[Install]
WantedBy=sleep.target

이제 작동합니다. 즉, 재생이 중지되었습니다. 그러나 systemd가 실제로 일시 중지 모드로 들어가는 데 오랜 시간이 걸립니다. Journalctl의 로그를 보면 다음과 같습니다.

Jun 05 23:43:53 localhost.localdomain systemd[1]: Starting Suspend...
Jun 05 23:44:18 localhost.localdomain systemd-sleep[7052]: Error: org.freedesktop.DBus.Error.NoReply
Jun 05 23:44:18 localhost.localdomain systemd-sleep[7052]: Did not receive a reply. Possible causes include: the remote application did not send a reply, the 
Jun 05 23:44:18 localhost.localdomain systemd-sleep[7052]: Suspending system...

내 첫 번째 생각은 DBus 시스템 또는 Clementine 자체가 응답할 시간이 되기 전에 중단되어 중단을 초래한다는 것이었습니다. 그래서 위의 서비스 파일에 dbus 서비스에 대한 종속성을 추가해 보았습니다. 그러나 이것은 문제를 해결하지 못합니다.

어떤 아이디어가 있나요?

관련 정보