I have a headless Debian server that I use for music. It's connected to some speakers and I've set it up so that I can play music from my phone to the server via bluetooth pairing.
However, I've found that I need to have a user logged in so that I can start the bluetooth agent and pulseaudio server. What I end up doing is logging in via ssh and running
pulseaudio -D and then
bt-agent -d. This allows me to pair my phone to the server and play music from my phone. The problem with this is that I have to keep the user logged in and running otherwise it stops working.
How can I automatically start these daemons on boot that will persist?