Hey guys,

While I wouldn't consider myself a complete Linux newb, I'm at a bit of a loss here.

I'm trying to get Shairport, a Perl script that acts as an AirPlay speaker, to run as a "daemon" on my Ubuntu machine.

Originally, I had Shairport setup to run whenever I logged in through the "Startup Applications" system panel -- but I'd like the script to run in the background without requiring a user to be logged in.

Obviously, I can't run Shairport until Ubuntu has finished setting up all the audio and network (including avahi) requirements. I took a look at Upstart, and while I understand the event driven model, I'm not sure what I want to execute Shairport after or before. In Narwhal, I see a few things that might be relevant, including: alsa-restore, alsa-store, and avahi-daemon.

I'm also a little confused about how Ubuntu handles audio in general -- I know PulseAudio is the standard, but there appears to be some "hold overs" of ALSA stuff, or perhaps ALSA is just functioning as a plugin to Pulse. Either way, since I can't run Shairport with my own user account (as I don't want to have to login), is there any "gotchas" I should be aware of in terms of other users accessing audio-out?

TL;DR: How do I run an audio and network enabled Perl script as a daemon without requiring a login?

Thanks,

Ryan Marcus