Centova Technologies Inc.

Products and Services

Centova Cast
Customer Support
Centova Technologies
 

Centova Technologies Forum

Author Topic: Share directory tool, aka symlinks for v3  (Read 7451 times)

Roger

  • Centova Staff
  • *
  • Posts: 358
Share directory tool, aka symlinks for v3
« on: August 19, 2014, 05:43:16 pm »
Let me be the first to contribute (and hopefully not the last).

This script will mount (bind-mount) a shared media directory within another station's media folder.


Download link:
-------------------
http://webcap.org/downloads/setmount.sh


Recommended installation instructions:
-------------------
mkdir -p /usr/local/centovacast/usr/sbin

wget http://webcap.org/downloads/setmount.sh -O /usr/local/centovacast/usr/sbin/setmount

chmod a+x /usr/local/centovacast/usr/sbin/setmount


You can find more details of usage within the script itself.


If you need help or have any questions/comments, please post them here so everyone can benefit from the discussion.

EDIT: Broken links updated
« Last Edit: May 20, 2017, 03:02:06 am by Roger »

streamer0815

  • Newbie
  • *
  • Posts: 11
Re: Share directory tool, aka symlinks for v3
« Reply #1 on: October 07, 2014, 05:41:02 am »
After ~# /usr/local/centovacast/usr/sbin/setmount --add techno

Directory /usr/local/centovacast/var/vhosts/stream/var/spool/media will be bind to /usr/local/centovacast/var/vhosts/techno/var/spool/media/share

Press enter to continue, ctl+c to cancel:

Bind mount successful.

:~#

All files under /stream/var/spool/media were deleted. Can not even supposed to be...

Roger

  • Centova Staff
  • *
  • Posts: 358
Re: Share directory tool, aka symlinks for v3
« Reply #2 on: October 07, 2014, 12:37:26 pm »
After ~# /usr/local/centovacast/usr/sbin/setmount --add techno

Directory /usr/local/centovacast/var/vhosts/stream/var/spool/media will be bind to /usr/local/centovacast/var/vhosts/techno/var/spool/media/share

Press enter to continue, ctl+c to cancel:

Bind mount successful.

:~#

All files under /stream/var/spool/media were deleted. Can not even supposed to be...

Did you secure your files by setting read-only permissions? if not, then any DJ of the techno account with FTP access could have deleted them. There is a warning in the script notes about this.

Also, it seems that you changed the $SHAREPATH variable to a path within Centova Cast's chrooted environment (i.e another station's media folder). I didn't actually tested the script for this particular scenario as it is meant to share a directory outside Centova Cast's vhosts directory.

That said, it probably works just fine and someone just deleted the files, either that or /etc/fstab in your system uses a slightly different format for bind mounts.

Try removing the mount using the following command, and if your media folder returns to normal then it's a case of the latter.

/usr/local/centovacast/usr/sbin/setmount --remove techno


Regards.
« Last Edit: October 15, 2017, 08:29:10 pm by Roger »

fhisupport

  • Newbie
  • *
  • Posts: 8
Re: Share directory tool, aka symlinks for v3
« Reply #3 on: December 13, 2014, 09:15:45 am »
Hi

Very good script but I have a problem, created share folder is empty.

My shared folder is /home/sharedmp3 with one mp3 to test
I have changed SharePath=/home/sharedmp3

The contents of my etc/fstab :

/dev/sda1       /       ext4    errors=remount-ro,relatime      0       1
/dev/sda2       /home   ext4    defaults,relatime       0       2
/dev/sda3       none    swap    defaults        0       0
proc            /proc   proc    defaults                0       0
sysfs           /sys    sysfs   defaults                0       0
tmpfs           /dev/shm        tmpfs   defaults        0       0
devpts          /dev/pts        devpts  defaults        0       0
tmpfs /var/amavis/db tmpfs rw,size=10m,mode=700,uid=amavis,gid=amavis  0 0
tmpfs /var/amavis/tmp tmpfs rw,size=150m,mode=700,uid=amavis,gid=amavis  0 0
/home/centovavhosts   /usr/local/centovacast/var/vhosts    none   bind
/home/sharedmp3  /usr/local/centovacast/var/vhosts/cookerseb/var/spool/media/share  none bind
/home/sharedmp3  /usr/local/centovacast/var/vhosts/djm/var/spool/media/share  none bind

The /home/sharedmp3 and share folder created which user owner/group and chmod they should have?

As you can see a few month I already moved centova vhosts to home because usr partition was too small :/home/centovavhosts   /usr/local/centovacast/var/vhosts    none   bind
Is my problem come from this ?

Thanks

Roger

  • Centova Staff
  • *
  • Posts: 358
Re: Share directory tool, aka symlinks for v3
« Reply #4 on: December 18, 2014, 05:16:31 pm »

As you can see a few month I already moved centova vhosts to home because usr partition was too small :/home/centovavhosts   /usr/local/centovacast/var/vhosts    none   bind
Is my problem come from this ?

Thanks

Hello fhisupport,

Sorry about the delay on this reply, the answer is yes (most likely), try changing the "VHOSTPATH=" variable to "/home/centovavhosts"


HTH

ozivaldo

  • Newbie
  • *
  • Posts: 2
Re: Share directory tool, aka symlinks for v3
« Reply #5 on: August 10, 2015, 01:38:13 pm »
Hello,
When trying to add a user for sharing:
# /usr/local/centovacast/usr/sbin/setmount.sh --add elienazio


I get the following error message:
-bash: /usr/local/centovacast/usr/sbin/setmount.sh: No such file or directory


I do not understand because I see that this file "setmount" is precisely located in the correct location:
"/ usr / local / centovacast / usr / sbin / setmount"

Roger

  • Centova Staff
  • *
  • Posts: 358
Re: Share directory tool, aka symlinks for v3
« Reply #6 on: August 10, 2015, 04:23:55 pm »
Hello,
When trying to add a user for sharing:
# /usr/local/centovacast/usr/sbin/setmount.sh --add elienazio


I get the following error message:
-bash: /usr/local/centovacast/usr/sbin/setmount.sh: No such file or directory


I do not understand because I see that this file "setmount" is precisely located in the correct location:
"/ usr / local / centovacast / usr / sbin / setmount"

That is because setmount.sh doesn't exist, either that or you didn't apply executable permissions correctly, if you followed the download instructions so that the script file is called "setmount" you should instead use use:

/usr/local/centovacast/usr/sbin/setmount --add username

If however you can see "setmount.sh" with the "sh" extension, then just re-set permissions like so:

chmod 755 /usr/local/centovacast/usr/sbin/setmount.sh

HTH

ozivaldo

  • Newbie
  • *
  • Posts: 2
Re: Share directory tool, aka symlinks for v3
« Reply #7 on: August 11, 2015, 12:59:52 pm »
Hello,
I gave permission that way:
chmod 755 / usr / local / centovacast / usr / sbin / setmount

When trying to add the user, I get the error message on the line 130 of the script

# sh /usr/local/centovacast/usr/sbin/setmount --add correcao
: command not foundast/usr/sbin/setmount: line 39:
: command not foundast/usr/sbin/setmount: line 44:
: command not foundast/usr/sbin/setmount: line 47:
: command not foundast/usr/sbin/setmount: line 50:
: command not foundast/usr/sbin/setmount: line 52:
: command not foundast/usr/sbin/setmount: line 55:
/usr/local/centovacast/usr/sbin/setmount: line 130: syntax error: unexpected end of file

Roger

  • Centova Staff
  • *
  • Posts: 358
Re: Share directory tool, aka symlinks for v3
« Reply #8 on: August 12, 2015, 03:37:44 pm »
Hello,
I gave permission that way:
chmod 755 / usr / local / centovacast / usr / sbin / setmount

When trying to add the user, I get the error message on the line 130 of the script

# sh /usr/local/centovacast/usr/sbin/setmount --add correcao
: command not foundast/usr/sbin/setmount: line 39:
: command not foundast/usr/sbin/setmount: line 44:
: command not foundast/usr/sbin/setmount: line 47:
: command not foundast/usr/sbin/setmount: line 50:
: command not foundast/usr/sbin/setmount: line 52:
: command not foundast/usr/sbin/setmount: line 55:
/usr/local/centovacast/usr/sbin/setmount: line 130: syntax error: unexpected end of file

Hello ozivaldo,

This script requires BASH and will not work with SH, if you continue to put "sh" in front of the actual command line it will never work.

tonimad

  • Newbie
  • *
  • Posts: 4
Re: Share directory tool, aka symlinks for v3
« Reply #9 on: May 04, 2017, 03:31:06 pm »
Hello,

I need this script but the link (to dropbox) is no longer available.

If someone has this script, can reupload it to somewhere, or paste the code here?

Thanks.

Roger

  • Centova Staff
  • *
  • Posts: 358
Re: Share directory tool, aka symlinks for v3
« Reply #10 on: May 20, 2017, 03:06:44 am »
Hello,

I need this script but the link (to dropbox) is no longer available.

If someone has this script, can reupload it to somewhere, or paste the code here?

Thanks.

Thank you for reporting this, and sorry that it has taken me couple of weeks to respond.

Unfortunately Dropbox has the habit of changing their method of sharing files, making it difficult to maintain a permanent link for an extended period of time.

I have now uploaded the script to a private domain, where it should remain available indefinitely.