FD- / RPiPlay

An open-source AirPlay mirroring server for the Raspberry Pi. Supports iOS 9 and up.
GNU General Public License v3.0
4.9k stars 354 forks source link

Add instructions to create systemd service #276

Open menahishayan opened 2 years ago

menahishayan commented 2 years ago

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

B0rax commented 2 years ago

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 commented 2 years ago

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

createcandle commented 2 years ago

@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 commented 2 years ago

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.