[Icecast] Re: Ices with perl playlist - multiple instances

Andy Baxter andy at earthsong.free-online.co.uk
Sun Sep 12 14:48:32 PDT 2004

On Tue, 07 Sep 2004 14:22:24 +0100, James McCurrach wrote:

> Hello,
> I'd like to be able to run multiple instances of Ices (2.0), each with
> their own playlist and streaming to different mountpoints.
> Although I'm relatively new to Ices and Icecast, so far I have had
> little trouble getting it running with two or more instances of Ices
> feeding off fixed playlists (files).
> I'd like to be able to set each instance of Ices to run with script
> based playlists (there are plenty of perl modules etc which do this
> well), with the playlist itself in the form of a table in a MySQL
> database.
> viz:
>         mount #1         mount #2
>              |                    |
>              --------|-------
>                    icecast (2.0)
>              --------|-------.............. as many channels as I want
>              |                    |
>           ices #1            ices #2
>              |                     |
>           next file            next file
>              |                     |
>              --------|--------..............
>                         |
>                    perl script
>                         |
>                     MySQL table
>                      (file name)
>                      (stream #)
>                      (play order)
> The problem is that I can't see how to get Ices to send some form of
> parameter to the perl script so that it knows which instance is calling
> it and can then pull the right next track filename from the DB.  There
> is the pidfile option in the config.xml, so that as I invoke each Ices
> instance I can capture the pid (for signalling etc) but how can I pass
> this pid or other identifier to the perl script?
> Apologies in advance if this has already been dealt with, but I couldn't
> find it in the archives.
> Thanks,
> James

If the playlist script has been invoked by ices, then ices should be its
parent process. You can find out the parent process of a given process
from inside perl, if this helps. Or if there are only going to be a few
instances of the script, run each one through a different symbolic link
(ln -s), and then read the command line inside the perl script.

More information about the Icecast mailing list