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

Include systemd-user service file #198

Closed
wants to merge 4 commits into from
Closed

Include systemd-user service file #198

wants to merge 4 commits into from

Conversation

WhyNotHugo
Copy link

Include a systemd.services file to run as a user

Also document both this and the pre-existing service file and how they should be used.

ExecStart=/usr/bin/librespot --name "%n@%H"

[Install]
tWantedBy=default.target
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you have a typo here? tWantedBy

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! Fixed!

@maxx
Copy link

maxx commented Jun 15, 2017

Also, I believe you mean systemctl enable rather than systemd enable in the README addition.

Also, my system (raspbian) doesn't allow --now .. I simply systemctl enable librespot

@@ -9,7 +9,7 @@ User=nobody
Group=audio
Restart=always
RestartSec=10
ExecStart=/usr/bin/librespot -n "%p on %H"
ExecStart=/bin/sh -c 'exec /usr/bin/librespot --name librespot@$(hostname -s)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really think it's necessary to spawn another shell here around for librespot? I understand the problem, and maybe I'm a little OCD here, but I think the source of the bug should be fixed, which is that librespost should probably encode the device name so it's safe for use in a DNS node.
screen shot 2017-06-15 at 12 25 43
I've tried to give the iOS Spotify app a device name with a point in it, and there it works.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly due to #200. I can wait for this to be merged until that issue has been resolved, if you'd rather not have this hack here.

I've tried with the iOS app too -- using a FQDN fails, and I tried things as basic as "te.st", and that fails. (if it works for you, let's please discuss that at #200).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the shell is actually needed because syntax like $(hostname -s) isn't accepted here, so it's slightly kind of a hack for the above bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, hadn't seen #200 before, thanks for reporting the issue. So I don't really mind anymore, and if/when #200 will be resolved, the workaround can still be made undone.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather fix #200 independently, and not include the workaround in here.

@WhyNotHugo
Copy link
Author

Yup, you're right, it's systemctl, not systemd. My bad, good catch. 😅


[Service]
Restart=always
RestartSec=12
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

librespot.service use 10 here.

I don't really care about the value, but it should be consistent

dmeulen pushed a commit to dmeulen/librespot that referenced this pull request May 16, 2019
@WhyNotHugo WhyNotHugo closed this Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants