Skip to content

Commit

Permalink
Harden systemd service, update restart policy (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlvince authored Nov 26, 2021
1 parent 97399e2 commit bbd575e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [main] Enforce reasonable ranges for option values (breaking).
- [main] Don't evaluate options that would otherwise have no effect.
- [playback] `alsa`: Improve `--device ?` functionality for the alsa backend.
- [contrib] Hardened security of the systemd service units

### Added
- [cache] Add `disable-credential-cache` flag (breaking).
Expand Down
8 changes: 4 additions & 4 deletions contrib/librespot.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Description=Librespot (an open source Spotify client)
Documentation=https://github.com/librespot-org/librespot
Documentation=https://github.com/librespot-org/librespot/wiki/Options
Requires=network-online.target
After=network-online.target
Wants=network.target sound.target
After=network.target sound.target

[Service]
User=nobody
Group=audio
DynamicUser=yes
SupplementaryGroups=audio
Restart=always
RestartSec=10
ExecStart=/usr/bin/librespot --name "%p@%H"
Expand Down
2 changes: 2 additions & 0 deletions contrib/librespot.user.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Description=Librespot (an open source Spotify client)
Documentation=https://github.com/librespot-org/librespot
Documentation=https://github.com/librespot-org/librespot/wiki/Options
Wants=network.target sound.target
After=network.target sound.target

[Service]
Restart=always
Expand Down

0 comments on commit bbd575e

Please sign in to comment.