From b9eb4de090d38813ab3432f6e18a9fea76414732 Mon Sep 17 00:00:00 2001 From: herrernst Date: Wed, 21 Dec 2016 23:21:40 +0100 Subject: [PATCH] add basic systemd service unit example put to /etc/systemd/system/librespot.service and then do `systemctl daemon-reload` --- Cargo.toml | 3 ++- assets/librespot.service | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 assets/librespot.service diff --git a/Cargo.toml b/Cargo.toml index df5b2781..7fe4760f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,5 +92,6 @@ available in the official library.""" section = "sound" priority = "optional" assets = [ - ["target/release/librespot", "usr/bin/", "755"] + ["target/release/librespot", "usr/bin/", "755"], + ["assets/librespot.service", "lib/systemd/system/", "644"] ] diff --git a/assets/librespot.service b/assets/librespot.service new file mode 100644 index 00000000..0750a0e0 --- /dev/null +++ b/assets/librespot.service @@ -0,0 +1,14 @@ +[Unit] +Description=Librespot +Requires=network-online.target +After=network-online.target + +[Service] +#User=librespot +Restart=always +RestartSec=10 +ExecStart=/usr/bin/librespot -n "%p on %H" + +[Install] +WantedBy=multi-user.target +