openairplay / goplay2

Airplay 2 Receiver written in Go
Apache License 2.0
385 stars 20 forks source link

Best way to run GoPlay on RPi at boot up? #24

Open pocketcolin opened 3 years ago

pocketcolin commented 3 years ago

GoPlay2 is working great for me, but I can't for the life of me get it to start on boot up. Is there a setting for that or a service I can use?

AlbanSeurat commented 3 years ago

I have created a Systemd unit file for that. I am off from my computer until Sunday. I will send it Monday.

AlbanSeurat commented 3 years ago

Here is the service unit file I am using on Rasbpian (RP1)

[Unit]
Description = airplay2 music receiver
After = network.target
Requires=pulseaudio.socket

[Service]
WorkingDirectory=/home/pi/goplay2
ExecStart=+/home/pi/goplay2/goplay2 -n hifi
User=pi
Group=pi

[Install]
WantedBy = multi-user.target

copy the file in this directory :

/lib/systemd/user/goplay2.service

and then activate the service :

systemctl --user enable goplay2