Can multiple streams share the same server-side MP3s?

Question:

How can I setup multiple, independent streams to share the same server-side MP3s for use with Centova Cast?

Answer:

Sharing MP3s between streams is not supported directly by Centova Cast, but you can achieve the same functionality creating a bind mount in the stream's var/spool/media/ directory which points a shared directory. So for example, you might do this:

  1. Put all of your shared MP3 files in the folder:
    /usr/local/centovacast/sharedmp3s/

  2. Create a directory for the shared MP3 files under the stream account:

    mkdir /usr/local/centovacast/var/vhosts/USERNAME/var/spool/media/shared
    
  3. Create a bind mount by editing /etc/fstab and adding:

    /usr/local/centovacast/sharedmp3s /usr/local/centovacast/var/vhosts/USERNAME/var/spool/media/shared none bind
    
  4. Mount the shared directory by running:

    mount /usr/local/centovacast/var/vhosts/USERNAME/var/spool/media/shared
    

You should of course replace USERNAME with the username for each stream.

Note that unless you use UNIX filesystem permissions to "lock down" the existing MP3s and prevent modifications, all users who have access to the shared directory will have permission to add, remove, and modify MP3s.

Also note that while a bind mount exists in an account, that account cannot be deleted. You must unmount the bind mount and remove it from /etc/fstab before attempting to delete the account.

NOTE: This article is for Centova Cast v3 only; an alternate version exists for Centova Cast v2.