spotifyd
spotifyd copied to clipboard
Update docs: system wide services cannot access a user keyring
Description
The documentation describes hot to store login credentials in the user's keyring, either by specifying use_keyring=true in the configuration or by specifying --use-keyring on the command line. The documentation also explains how to run spotifyd in systemd, as either a user service or as a system service.
However, running as a system service rules out the option of using the user's keyring, because a system service cannot access a specific user's keyring. There is not mention about this in the documentation and it took me a while to figure out. While searching for a solution I came across questions from other users who faced the same problem.
I'm providing PR #1247 to update the documentation accordingly.
To Reproduce
Run spotifyd as a system service and try to access the user's keyring.
- copy the systemd config file into
/etc/systemd/system - specify
use_keyring=truein the spotifyd configuration - spotifyd fails to start, because a system service cannot access a specific user's keyring
Expected behavior
Spotifyd fails to start, this is expected behavior.
Just update the documentation accordingly.
Logs
Click to view logs
Dec 13 14:10:39 x220 systemd[1]: Started spotifyd.service - A spotify playing daemon.
Dec 13 14:10:39 x220 spotifyd[17969]: No config file specified. Running with default values
Dec 13 14:10:39 x220 spotifyd[17969]: No password specified. Checking password_cmd
Dec 13 14:10:39 x220 spotifyd[17969]: No password_cmd specified
Dec 13 14:10:39 x220 spotifyd[17969]: No proxy specified
Dec 13 14:10:39 x220 spotifyd[17969]: Using software volume controller.
Dec 13 14:10:39 x220 spotifyd[17969]: Checking keyring for password
Dec 13 14:10:39 x220 spotifyd[17969]: Keyring did not return any results: Platform secure storage failure>
Dec 13 14:10:39 x220 spotifyd[17969]: no usable credentials found, enabling discovery
Dec 13 14:10:39 x220 spotifyd[17969]: The application panicked (crashed).
Dec 13 14:10:39 x220 spotifyd[17969]: Message: called `Result::unwrap()` on an `Err` value: DnsSdError(O>
Dec 13 14:10:39 x220 spotifyd[17969]: Location: src/setup.rs:105
Dec 13 14:10:39 x220 spotifyd[17969]: Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable t>
Dec 13 14:10:39 x220 spotifyd[17969]: Run with RUST_BACKTRACE=full to include source snippets.
Dec 13 14:10:39 x220 systemd[1]: spotifyd.service: Main process exited, code=exited, status=101/n/a
Dec 13 14:10:39 x220 systemd[1]: spotifyd.service: Failed with result 'exit-code'.
Dec 13 14:10:42 x220 systemd[1]: spotifyd.service: Failed to schedule restart job: Unit spotifyd.service >
Dec 13 14:10:42 x220 systemd[1]: spotifyd.service: Failed with result 'exit-code'.
Compilation flags
- [x] dbus_mpris
- [x] dbus_keyring
- [ ] alsa_backend
- [ ] portaudio_backend
- [x] pulseaudio_backend
- [ ] rodio_backend
Versions (please complete the following information):
- OS:
- Spotifyd:
0.3.5 - cargo:
1.74.1 (ecb9851af 2023-10-18)