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

Add instructions to create systemd service #276

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

menahishayan
Copy link

Added instructions in the README to properly autostart the server on boot using a systemd service.

@B0rax
Copy link

B0rax commented Dec 26, 2021

I followed your guide but I was not successful (I'm not a linux expert).

when I ran the command systemctl enable rpiplayIt asked to authenticate me in big red letters which I found a bit odd:

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Authenticating as: ,,, (pi)
Password: 
==== AUTHENTICATION COMPLETE ===
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.
Authenticating as: ,,, (pi)
Password:
==== AUTHENTICATION COMPLETE ===

after this I tried starting the service like you wrote with systemctl start rpiplayIt then again asked to verify me in big red letters:

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'rpiplay.service'.
Authenticating as: ,,, (pi)
Password: 
==== AUTHENTICATION COMPLETE ===
Failed to start rpiplay.service: Unit rpiplay.service has a bad unit file setting.

As you can see it failed.

I am running a raspberry pi zero with raspbian buster light.

@menahishayan
Copy link
Author

I'm going to need to see the exact rpiplay.service file that you created to understand what went wrong

@createcandle
Copy link

@B0rax You need to run sudo systemctl enable rpiplay instead. Only users with root privileges are allowed to make changes to the systemd system, since without that security it would allow all kinds of software to automatically start at boot.

@menahishayan
Copy link
Author

Yes @B0rax using sudo would get rid the Authentication message in "big red letters" as you call it. However, Failed to start rpiplay.service: Unit rpiplay.service has a bad unit file setting. is interesting. Give sudo a try and see if it solves the problem. If not, lets look at the rpiplay.service file and see what went wrong. but using services is the right approach and should be the way we go about it.

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

3 participants