Centova Technologies Forum

Centova Cast v3 => General discussion => Topic started by: soundboxaudio on February 17, 2013, 09:12:21 am

Title: Symlinks and Binding
Post by: soundboxaudio on February 17, 2013, 09:12:21 am
Hello,

as i understand v3 no longer supports using symlinks in the media library. Could someone please expand on how i could possibly using bind points to implement a shared media library across multiple streams? I can set up a bind and mount it to one stream no problem, however i seem unable to then bind the same directory to another stream in order for both streams to use the shared media folder? Any help would be great.

thanks,
gavin
Title: Re: Symlinks and Binding
Post by: Centova - Steve B. on February 18, 2013, 07:07:59 pm
Code: [Select]
cx001:/usr/local/centovacast/var/vhosts# mkdir sharedmedia
cx001:/usr/local/centovacast/var/vhosts# cd sharedmedia
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# touch test1.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# touch test2.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# touch test3.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# ll
total 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# cd ..
cx001:/usr/local/centovacast/var/vhosts# ll
total 16
drwxr-xr-x 2 root root 4096 Feb 18 19:03 sharedmedia
drwxr-xr-x 3 root root 4096 Feb 18 19:03 stream1
drwxr-xr-x 3 root root 4096 Feb 18 19:03 stream2
drwxr-xr-x 3 root root 4096 Feb 18 19:03 stream3
cx001:/usr/local/centovacast/var/vhosts# mount --bind sharedmedia stream1/var/spool/media
cx001:/usr/local/centovacast/var/vhosts# mount --bind sharedmedia stream2/var/spool/media
cx001:/usr/local/centovacast/var/vhosts# mount --bind sharedmedia stream3/var/spool/media
cx001:/usr/local/centovacast/var/vhosts# ll stream1/var/spool/media
ttotal 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts# ll stream2/var/spool/media
total 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts# ll stream3/var/spool/media
total 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts#
Title: Re: Symlinks and Binding
Post by: crossfirehosting on May 31, 2013, 02:41:50 pm
is that how to do symlink on v3.

If not can you explain how to do it i got a client asking about symlink for a private reseller

Kris
Title: Re: Symlinks and Binding
Post by: Alexiu on June 02, 2013, 04:03:10 am
the procedure is detailed under the "Client Data (Linux)" section here:
http://www.centova.com/doc/cast/internals/files

The article explains how to setup a bind mount for the entire /vhosts/ directory (so for all your users), so if you want to create it for a single user, you should replace /usr/local/centovacast/var/vhosts with /usr/local/centovacast/var/vhosts/USERNAME   (replace USERNAME with the actual user's account name)
Title: Re: Symlinks and Binding
Post by: Dr Bunsen on June 26, 2013, 04:11:03 am
What impact would running this change have on a running server (e.g: would the streams need to be restarted, etc)?

Thanks.
---
Code: [Select]
cx001:/usr/local/centovacast/var/vhosts# mkdir sharedmedia
cx001:/usr/local/centovacast/var/vhosts# cd sharedmedia
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# touch test1.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# touch test2.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# touch test3.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# ll
total 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts/sharedmedia# cd ..
cx001:/usr/local/centovacast/var/vhosts# ll
total 16
drwxr-xr-x 2 root root 4096 Feb 18 19:03 sharedmedia
drwxr-xr-x 3 root root 4096 Feb 18 19:03 stream1
drwxr-xr-x 3 root root 4096 Feb 18 19:03 stream2
drwxr-xr-x 3 root root 4096 Feb 18 19:03 stream3
cx001:/usr/local/centovacast/var/vhosts# mount --bind sharedmedia stream1/var/spool/media
cx001:/usr/local/centovacast/var/vhosts# mount --bind sharedmedia stream2/var/spool/media
cx001:/usr/local/centovacast/var/vhosts# mount --bind sharedmedia stream3/var/spool/media
cx001:/usr/local/centovacast/var/vhosts# ll stream1/var/spool/media
ttotal 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts# ll stream2/var/spool/media
total 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts# ll stream3/var/spool/media
total 0
-rw-r--r-- 1 root root 0 Feb 18 19:03 test1.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test2.mp3
-rw-r--r-- 1 root root 0 Feb 18 19:03 test3.mp3
cx001:/usr/local/centovacast/var/vhosts#
Title: Re: Symlinks and Binding
Post by: Roger on June 26, 2013, 11:15:27 am
What impact would running this change have on a running server (e.g: would the streams need to be restarted, etc)?

Thanks.

That is just an example, the article mentioned by Alexiu explains how to add this mounts to fstab so that they'll be re-mounted in case of a server reboot.
Title: Re: Symlinks and Binding
Post by: Dr Bunsen on June 26, 2013, 04:34:40 pm
I realise that but is adding the new mounts transparent to Centova or does the webserver need restarting, etc?
Title: Re: Symlinks and Binding
Post by: Roger on June 26, 2013, 08:09:23 pm
I realise that but is adding the new mounts transparent to Centova or does the webserver need restarting, etc?

Mounts occur at a kernel level, so yes they are transparent for any application. It will be as if you just moved some files there.

HTH
Title: Re: Symlinks and Binding
Post by: Dr Bunsen on June 26, 2013, 10:44:19 pm
Thanks Roger.