Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update systemd documentation and systemd examples #894

Merged
merged 5 commits into from Sep 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 20 additions & 4 deletions docs/src/config/services/Systemd.md
@@ -1,4 +1,6 @@
# Running spotifyd as a service using systemd
# Running spotifyd as a systemd service
eladyn marked this conversation as resolved.
Show resolved Hide resolved

## As as a user service

A `systemd.service` unit file is provided to help run spotifyd as a service on systemd-based systems. The file `contrib/spotifyd.service` should be copied to either:

Expand All @@ -9,9 +11,23 @@ A `systemd.service` unit file is provided to help run spotifyd as a service on s

Packagers of systemd-based distributions are encouraged to include the file in the former location. End-user should prefer the latter. It should be noted that some targets are not available when running under the user directory, such as `network-online.target`.

Control of the daemon is handed over to systemd. The following example commands will run the service once and enable the service to always run on login in the future respectively:
Control of the daemon is handed over to systemd. The following command will start the service whenever the user logs in to the system. Logging out will stop the service.

```bash
systemctl --user enable spotifyd.service --now
```

## As a system wide service

A `systemd.service` unit file is provided to help run spotifyd as a service on systemd-based systems. The file `contrib/spotifyd.service` should be copied to:

```bash
/etc/systemd/system/
```

Control of the daemon is handed over to systemd. The following example commands will start the service and keep it running across reboots.

```bash
systemctl --user start spotifyd.service
systemctl --user enable spotifyd.service
systemctl daemon-reload
systemctl enable spotifyd.service --now
```