Permissions to write to jails directory

Status
Not open for further replies.
Joined
Jan 27, 2015
Messages
6
Hello, noob to Freenas here. I need to replace a file in the jails directory to allow SABnzbd to talk to CouchPotato correctly and according to this post on reddit: -

http://www.reddit.com/r/usenet/comments/2slu1s/problems_with_couchpotato_grabbing_from_nzbsu_fix/

And looking at this location: -

\jails\couchpotato_1\usr\pbi\couchpotato-amd64\share\couchpotato\CouchPotatoServer\couchpotato\core\media\movie\providers\nzb

This is the one I need to replace, but I am unable to do this using a Windows CIFS share.

Am I missing something, is there another easy way to do this? Or do I have to amend permissions so the Windows share can write. The last time I tried to change permissions, I screwed up my plugins and had to reinstall. I've taken snapshots this time! The current owner of /jails is root:wheel, my other media directories that I can read/write to are nobody:nogroup. I done it like this after following a YouTube guide. I have not needed to create a new user since setting up FreeNAS, everything is working so far, all plugins etc. I understand this may not be best practice.

Please go easy on me if I have not posted correctly. If there is any information that I have clearly missed, please let me know and I will edit my post straight away, I have read the rules however.

Many thanks in advance if you can help me, this is driving me nuts.

Edit: I have searched the web and this forum high and low to find a similar thread. Please let me know if there is one I have missed! :)

And I've also noticed that this is in the wrong category really, can I move it?
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
When modifying jails you need to use the cli. jls will show you running jails and 'jexec <jail id> tcsh' will put you in that jail and you can modify the files you want.
 
Joined
Jan 27, 2015
Messages
6
When modifying jails you need to use the cli. jls will show you running jails and 'jexec <jail id> tcsh' will put you in that jail and you can modify the files you want.

So based on this I'm assumming the process would be: -
  1. Find the running jail (cli. jls)
  2. Enter the jail (jexec <jail id> tcsh)
  3. Turn off the jail/plugin, shutdown via GUI?
  4. Replace files with commands
  5. Turn the jail/plugin back on again
Let me know if my logic is not quite right. I need to research how to do point 4.

I'll look this up and report back. Thanks
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
the proper way to do this is to have the fix to that file be merged upstream. submit a PullRequest to the CouchPotato github.

once the fix is merged into the master branch just pull the update from within CouchPotato.
 
Joined
Mar 6, 2014
Messages
686
Just put the downloaded file to a NAS share that you can access (i.e. where your media is stored) and that is mounted in your jail too (i.e. /mnt/media). Copy it inside the jail from there to the correct location inside the jail (which is probably not the one you mention in your first post).

But, since you are a newbie, so new in fact that you don't even know the command to copy a file (no offence), i would reccommend you to do like Joshua said and wait for the fix to be implemented in CouchPotato.
 
Joined
Jan 27, 2015
Messages
6
Just put the downloaded file to a NAS share that you can access (i.e. where your media is stored) and that is mounted in your jail too (i.e. /mnt/media). Copy it inside the jail from there to the correct location inside the jail (which is probably not the one you mention in your first post).

But, since you are a newbie, so new in fact that you don't even know the command to copy a file (no offence), i would reccommend you to do like Joshua said and wait for the fix to be implemented in CouchPotato.

Great, I will give that a go. Switching off all plugins, taking snapshots and config backups etc.

No offence taken, I will look it up though and work out how to do it. Despite being a Java developer and knowing a handful of languages, this is a completely new kettle of fish to me! :)

Thank you for the advice.
 
Joined
Jan 27, 2015
Messages
6
Just put the downloaded file to a NAS share that you can access (i.e. where your media is stored) and that is mounted in your jail too (i.e. /mnt/media). Copy it inside the jail from there to the correct location inside the jail (which is probably not the one you mention in your first post).

But, since you are a newbie, so new in fact that you don't even know the command to copy a file (no offence), i would reccommend you to do like Joshua said and wait for the fix to be implemented in CouchPotato.
Success! Here's what I did, just in case any other noob like me comes along: -

  1. Switch off couchpotato plugin
  2. Took a snapshot of the couchpotato jail
  3. Placed my new source file in the source directory of jail,
  4. Found running Jail ID with
    Code:
    jls
  5. Entered jail with
    Code:
    jexec <jail id> tcsh
  6. Change directory to source directory of jail (correct terminology?) with
    Code:
    cd media
  7. Copied and replaced new file with
    Code:
    cp -iv newznab.py <path to destination>/newznab.py
    , -iv used to prompt replace and return status
  8. Change directory to location of pyc file that needs to be removed with
    Code:
    cd <path to destination>
  9. Delete newznab.pyc file (as will be recreated when jail switched on again)
    Code:
    rm newznab.pyc
  10. Switch plugin back on!
After testing, couch potato is now working as I wanted it to!

I know my steps above are like bread and butter to most on here, but I thought I should return with my solution. But please do advise on this thread if this is not really good practice.

Thanks
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Success! Here's what I did, just in case any other noob like me comes along: -

  1. Switch off couchpotato plugin
  2. Took a snapshot of the couchpotato jail
  3. Placed my new source file in the source directory of jail,
  4. Found running Jail ID with
    Code:
    jls
  5. Entered jail with
    Code:
    jexec <jail id> tcsh
  6. Change directory to source directory of jail (correct terminology?) with
    Code:
    cd media
  7. Copied and replaced new file with
    Code:
    cp -iv newznab.py <path to destination>/newznab.py
    , -iv used to prompt replace and return status
  8. Change directory to location of pyc file that needs to be removed with
    Code:
    cd <path to destination>
  9. Delete newznab.pyc file (as will be recreated when jail switched on again)
    Code:
    rm newznab.pyc
  10. Switch plugin back on!
After testing, couch potato is now working as I wanted it to!

I know my steps above are like bread and butter to most on here, but I thought I should return with my solution. But please do advise on this thread if this is not really good practice.

Thanks
it's not because CP now is not working with the same set of files that it expected based on the version file it's maintaining. so it could cause conflicts if, say, CP decided to implement the fix in a different way.

but you could always go in the commandline and fix things up yourself.

####

this is an open source program, with a responsive developer. my perspective is if possible push the fix upstream so the dev will integrate it in for everyone. but either way works just be ready if something breaks, lol.
 
Joined
Jan 27, 2015
Messages
6
it's not because CP now is not working with the same set of files that it expected based on the version file it's maintaining. so it could cause conflicts if, say, CP decided to implement the fix in a different way.

but you could always go in the commandline and fix things up yourself.

####

this is an open source program, with a responsive developer. my perspective is if possible push the fix upstream so the dev will integrate it in for everyone. but either way works just be ready if something breaks, lol.

Agreed. I shall leave the fix as it is now. I have backed up the original files and taken a snapshot of the jail to revert if I need to. But I do get what you are saying, this is not a fix, this is a fudge that could break easily.

I learnt a lot in the process however, so thanks everyone for your input.
 
Status
Not open for further replies.
Top