sabnzbd / sickbeard / couchpotato pbi's

Status
Not open for further replies.

Nathan Wilbury

Dabbler
Joined
Jun 27, 2012
Messages
11
Yeah you can install the plugins and then see if you can somehow get the menus to work. look at where the official plugins have their menu files (written in javascript). We then need to create similar files to configure options like enabling the service, or starting the service (both these just need to run commands). I haven't been able to look at the plugins or docs for 8.2beta4 but I did try unsuccessfully with beta3. Not sure if much has changed.

Goodluck, and tell me if you need any help!
http://doc.freenas.org/index.php/Plugins look at the section "Creating your own FreeNAS™ PBIs"

On it. I had forgotten that it was written in Django, which is my framework of choice.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
On it. I had forgotten that it was written in Django, which is my framework of choice.

you wanna get the control file to run 'service pluginname start/stop' to start or stop the service.
and add pluginname_enable="YES" to /etc/rc.conf (check how they do this in the official plugins) to enable the service.
other than that, all of the settings/updating can be controlled within the apps themselves. I packaged everything in such a way that all the app data is put in a 'data/' folder for easy tar.gz for plugin backups. not sure how freenas will implement this but I assumed this way was a reasonable idea.
 

Nathan Wilbury

Dabbler
Joined
Jun 27, 2012
Messages
11
you wanna get the control file to run 'service pluginname start/stop' to start or stop the service.
and add pluginname_enable="YES" to /etc/rc.conf (check how they do this in the official plugins) to enable the service.
other than that, all of the settings/updating can be controlled within the apps themselves. I packaged everything in such a way that all the app data is put in a 'data/' folder for easy tar.gz for plugin backups. not sure how freenas will implement this but I assumed this way was a reasonable idea.

OK. I know that you and protosd have had this discussion, but according to the docs "resources/tweak-rcconf" is responsible for adding the "*_enable='Yes'" to the "/etc/rc.conf". I opened up the transmission pbi so i could check where all the files lived. The transmissions pbi didn't have the resources folder, BUT the transmission plugin obviously has a tweak-rcconf file.

When the transmission (and firefly and minidlna) start the process, they get an ID from '/var/run/plugin_file_name.pid' to get the id of the process. Have you seen anywhere in the plugin references to these files?

The 'control' file is also used to start and stop the process.... KINDA. so the control file, runs the control.py script, which starts and stops the process ( and returns the status).

It is the control.py script that is used to start and stop the process after a pretty convoluted process, but the long and short of it is, if you want these plugins to be like the examples, we need to have these files to hook into.

The transmission one uses the transmission api to set all the settings, so it stores the apikey and secret in a file and calls them when needed. I know that you are not interested in doing that at the moment, but if in your travels you happen to find a way to get that out of the installation process or to set them, it will probably make things easier in the future.

I hope I helped a little and i will continue to try and set everything else up.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
did you look at the transmission source? I think the resources folder is there. with the source is a script with the pbi_make command which makes all the ports and packages everything into a pbi.

If anyone has the chance can they check if transmission is actually creating a pid file? If so I'll make sure to create one (as the way I have it setup isn't successfully creating a pid file).

By the way I don't care if my plugin matches the official ones, I just want it to work perfectly, be clean, and have simple source with as little hacks as possible.
 

Nathan Wilbury

Dabbler
Joined
Jun 27, 2012
Messages
11
I was opening up the .pbi file using 7zip and looking through that at what files where in the pbi and the resource folder wasn't in there. There were a lot of files that weren't in there though. I will read through the "how to make a plugin guide again to try to make more sense of it with hassling you idiotic questions.

Edit:

I LIED. first idiotic question. So from my reading of plugin docs, I could make my own version of the SABNZBD plugin, from the files that you have provided and running the "pbi_makeport -c" command, would make a new pbi?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
do you have a copy of my source? in it there should be some file, I think named make.sh or something. I am using pbi_create, which unlike pbi_makeport doesn't have to go out and make the latest versions of each of the dependancies. It saves alot of time building and I don't want to have to make the dependencies 4 times for each program (each and every time). pbi_create just creates the links from the external links file, and packages everything up into a pbi.

If you need my source I can grab it again and post it somewhere
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

ohh, those are the pbi's. Here's the source that I used to make it. Just upload it into a freebsd system (the jail on freenas works fine) and you can use the script I put in there called 'make_pbi.sh'.
http://eto.homeip.net/usenet-0.6.tar.gz

BEWARE - uninstall the plugins you are going to make before you make it, I have to use a workaround to make it seem like the plugins were already installed in '/usr/pbi'

ALSO the reason it's so big is cause I have all of the dependencies for each program in it's respective folder, they are prebuilt already as well.
 

Bacillus

Cadet
Joined
Jul 6, 2012
Messages
4
I followed the same steps and received the same error but I found sabnzbd was running. Check top and see if it is running. I asked Josh the same question afterwards and here was his response:
Please install the plugin through the gui.

To setup for example sabnzbd,
add.. sabnzbd_enable="YES" to /etc/rc.conf
and run.. service sabnzbd start

hope that clears things up


I've been trying to troubleshoot this same problem for hours and would appreciate any assistance Josh or other people can provide. Following is the list of steps I took:

1. Open FreeNAS web gui
2. Went to jail (services-->plugins)
3. Used "Install Plugin" button and installed the Sabnzbd PBI (sabnzbd-0.6-amd64.pbi)
*At this point Sabnzbd shows up in the PBI jail

GSSrU.png


4. Open up shell and typed "edit /etc/rc.conf" and hit enter
5. Editor opens up file (with such lines as 'nginx_enable="YES"' and jail_enable="YES")
6. Used arrow keys to move down to bottom of file and added "sabnzbd_enable="YES"

yxhuA.png


7. Hit esc to quit then enter then saved file (double checked to make sure changes were actually made)
8. After editor closes out, but still in shell, typed "service sabnzbd start" and hit enter

at this point I'm greeted with the dreaded "sabnzbd does not exist in /etc/rc.d or the local startup directories (/usr/local/etc/rc.d) "

I've tried to see if it's running by going to (192.168.1.18:8080), where 192.168.1.18 is the jailIP but the page can't load since sabnzbd isn't running. I believe I've followed the provided directions correctly, but clearly something isn't working.

Thanks for your time and help :)
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
You're editing the wrong /etc/rc.conf.
You're using the host, you should be editing the one inside the jail....

# jexec 1 csh
# vim /etc/rc.conf
 

Bacillus

Cadet
Joined
Jul 6, 2012
Messages
4
You're editing the wrong /etc/rc.conf.
You're using the host, you should be editing the one inside the jail....

# jexec 1 csh
# vim /etc/rc.conf

I initially tried it in the jail (at least I think I did)..I set up my jail following the instructions provided here http://doc.freenas.org/index.php/Plugins

I have /mnt/data as my volume..and created datasets "jail" and "software" so from there I tried /mnt/data/jail/software/etc/rc.conf and added the line there, but was encountering the same problem. I tried doing exactly the same thing again using your "jexec 1 csh" command and doing it and seemingly made progress, but ran into an error that isn't making sense to me. Steps I followed:

1. Open shell
2. "cd /mnt/data/jail/software/etc"
3. "jexec 1 csh"
4. "edit rc.conf"
5. Added "sabnzbd_enable="YES"
6. Saved and quit editor
7. "service sabnzbd start"

At this point I encounter a new error which doesn't make sense to me

Here's a screenshot:

yRNpD.png


Do I need to restart Freenas for that change to take effect?

Thank you so much for you speedy help and patience
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
you shouldn't have to restart. I'm guessing theres a small error in your line, you mind outputing what you get from 'cat /etc/rc.conf' (this is from within the jail)
 

Bacillus

Cadet
Joined
Jul 6, 2012
Messages
4
you shouldn't have to restart. I'm guessing theres a small error in your line, you mind outputing what you get from 'cat /etc/rc.conf' (this is from within the jail)

Hmm this is very weird, I tried repeating everything I did before, and some how it "appeared" to work but I am still encountering issues. I managed to get it to say "Starting sabnzbd" and "Starting sickbeard", but when I tried reaching the web interface (jailIP:8080) for it I couldn't get to it and upon running 'netstat -a | egrep "Proto|LISTEN"', neither sabnzbd or sickbeard showed up.

Here are two screenshots (first is the sabnzbd "starting' and the results of "cat /etc/rc.conf") and the second is the results of my "netstat")

mfHvN.png


bY7tW.png


If sabnzbd actually started like it said it did, would it properly have changed the "Service Status" button (Services -> plugins -> column in the jail) from off to on? Because both of these still appear to be "off" despite the "Starting sabnzbd" message I recieved in the shell.

EW2Ym.png



..I will admit that I have been slightly confused as to specifically where the "jail" path is located. I set up my jail using the guide here so I created two datasets (/mnt/data/jail and /mnt/data/software). I'm assuming it's the /mnt/data/jail directory, but within there there's only a "software" directory. Here are some screenshots of the different directories and their contents, to hopefully allow you to determine where I should be running this.

NBFNr.png


AO9Wn.png


Thank you again for all the help! I'm typically pretty savvy with this kinda stuff, but in the past 12-15 hours of tinkering and research I've been unable to fix this still :(
 

gesshoku

Dabbler
Joined
Jun 23, 2012
Messages
46
Hi Bacillus,

Edit1: The button will be displayed as "off", even though the service is running. i suspect this is due to the fact that there is no plugin-webinterface within the FreeNAS plugintree yet. This is also the reason why clicking on it won't start the service (this confused me a lot in the beginning ;-)).

Edit2: So first of all, you have to run the netstat command within the jail as well. The jail is like a kind of virtual machine running on FreeNAS (please correct me, if i'm wrong).
Secondly, did you try editing your sabnzdb-config within the jail as stated by Nathan: http://forums.freenas.org/showthrea...ouchpotato-pbi-s&p=30498&viewfull=1#post30498
The /usr/pbi... path that Nathan talks about is a sub-path/directy of your jail.


i've used protosd's guide to set up my jail and haven't had any problems if i recall correctly:
http://protosd.blogspot.com/2012/03/quick-guide-to-using-plugins-video-with.html
After properly reading your post, i assume that your jail is set up correctly and shouldn't be a problem.

As a sidenote, being a windows user, i've done most editing with WinSCP (occasionally you have to mount the system files as writable from the shell before editing).
 

Bacillus

Cadet
Joined
Jul 6, 2012
Messages
4
Hi Bacillus,

Edit1: The button will be displayed as "off", even though the service is running. i suspect this is due to the fact that there is no plugin-webinterface within the FreeNAS plugintree yet. This is also the reason why clicking on it won't start the service (this confused me a lot in the beginning ;-)).

Edit2: So first of all, you have to run the netstat command within the jail as well. The jail is like a kind of virtual machine running on FreeNAS (please correct me, if i'm wrong).
Secondly, did you try editing your sabnzdb-config within the jail as stated by Nathan: http://forums.freenas.org/showthrea...ouchpotato-pbi-s&p=30498&viewfull=1#post30498
The /usr/pbi... path that Nathan talks about is a sub-path/directy of your jail.


i've used protosd's guide to set up my jail and haven't had any problems if i recall correctly:
http://protosd.blogspot.com/2012/03/quick-guide-to-using-plugins-video-with.html
After properly reading your post, i assume that your jail is set up correctly and shouldn't be a problem.

As a sidenote, being a windows user, i've done most editing with WinSCP (occasionally you have to mount the system files as writable from the shell before editing).

Meh I just can't catch a break...if I fix one problem I encounter 20 new ones. Initially I had tried the netstat in the jail, but got an error "netstat: kvm not available: /dev/mem: No such file or directory" so I figured the jail didn't have access to /dev/mem which is needed for netstat.

I checked out that video you linked to and ran into various problems trying to follow his method. I first did a completely fresh install of FreeNAS to ensure there was no trace of any of the damage I probably did earlier and then tried to follow the video. I added the alias for the desired IP of the jail in the network-->interface-->re0 and saved that, but when i try to upload the jail pbi it kept telling me the IP address was already in use. I also am clueless about setting up the DNS nameserver like he said you have to do before you do anything. I read a few articles on it, but am not really sure what I need to do. My understanding though is I should be fine without it as long as I continue to use jailIP:8080 for SAB to access the web server (I still haven't gotten it working on this box).

I finally got sick of trying to get protosd's way to work so I decided to try my initial method. I removed the interface alias and tried to upload then jail pbi and it worked perfectly (I did use his naming scheme...datasets are Jail, Plugins; and jail is JailPlugin). I then went and added the 0.6 sabnzbd64 pbi that someone uploaded on an earlier page (since Joshua's server is/was down) and that installed perfectly. Now, after learning from my earlier mistakes , I entered into the jail (jexec 1 csh) and added the enabling line in the rc.conf. When I tried starting sabnzbd this time I got a new error for me, but one that people on previous pages have had.

wkvA2.png


I looked through this thread and noticed other people were having the same problem, but I didn't see any real solutions for it. I did see someone trying to fix a problem with missing Cheetah:

Exactly, install the PBI from Josh, find the sabnzbd folder in your jail/plugin and replace the files with the new ones from the sabnzbd site (http://sabnzbd.org/download/).
i did do the initial setup with the wizard before replacing, as i thought it would already be 0.7, but i assume that you can also replace before setting things up.

I'm not entirely sure where the "sabnzbd folder in our jail/plugin" is that he refers to; I was not finding anything in /mnt/data/Jail/PluginJail (jail directory). After exploring deeper I did find a "sabnzbd-amd64" directory in "/mnt/data/Jail/PluginJail/usr/pbi" but I'm not sure if that's the correct location and don't want to break things ..I did download the sabnzbd 7 (python source) as I'm assuming that's the version I should be using. Once I figure out what directory I should be replacing, can I just use "yes | cp -a /newSabnzbdfolder/. /currentSabnzbdfolder" to replace everything?

I can't thank you all enough for the continuing help and patience with my lack of experience with FreeNAS. I've been pulling hairs over this for days and would be with even less progress without you guys. It has been a valuable learning experience though as I've learned so much about freenas shell usage and other various things through all my tinkering and research. To be quite honest, this is my first experience with servers and I have only used very basic unix commands before so all of this has been very new to me, but I do program frequently and am in the middle of obtaining a comp sci degree so I should hopefully be competent enough to follow the majority of this. Just wish I had taken the Unix Systems class last semester rather than this upcoming one haha
 

gesshoku

Dabbler
Joined
Jun 23, 2012
Messages
46
Hi there again.
Well, i didn’t think you would be rebuilding the jail. But then again, some people might read it who haven’t even started yet, so here goes:
The guide by protosd is good and easy, but a bit outdated by now. The IP-part isn’t covered in the network settings anymore, but from within the plugin configuration itself. So don’t set it in the network screen, but rather during the plugin setup. I ran into this problem myself.
I’m not sure about the missing memory error when using netstat in the jail. But I believe I was able to see the ports despite that message (I just used “netstat”). Maybe I’ll test it later. I’m using my old FreeNAS right now, until the problems with Couch Potato are fixed :smile:
I did setup DNS, which usually is the IP of your router. You can also use any other DNS-Server (I chose the ones from openDNS: 208.67.220.220 and 208.67.222.222).


After exploring deeper I did find a "sabnzbd-amd64" directory in "/mnt/data/Jail/PluginJail/usr/pbi" but I'm not sure if that's the correct location and don't want to break things .

This should be the correct directory. Go one path deeper to find the config.ini: /data/config.ini
You should change it according to what was in my previous post.
Regarding the replacing of sabnzbd files, you should first try getting the package of Josh running. You can easily replace the files after that. (replacing them is not a solution for a problem, it’s just meant to bring sabnzbd to the latest version)
I’m not sure if you need to specify any attributes when using “cp” to do it. I copied the files using WinSCP.

Yes, Wolfeman0101 got the same error message as you, but with the CouchPotato plugin, which isn’t working anyway.
I know this is the last thing I should probably recommend, but did you try reinstalling the plugin?
Did you setup the jail the exact same way as you did before? I think you were only one config step away from having sabnzbd run the way you had it earlier.

My first FreeNAS setup took me a couple of weeks (I usually only had time during the weekends ;-)). I also learned a lot from that and now setting up FreeNAS again and again is quite easy. There is still a lot to learn though…
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'd say stick to always doing your work from within the jail (jexec 1 csh) as much as possible, it should help with some confusion.

Bacillus, just a sanity check, are you on 32 bit or 64 bit?

Within the jail /usr/pbi/plugin-arch/Plugin is where the source code for each program is downloaded. So that where you can replace the sabnzbd folder, just make sure everything is spelled/uppercased the same way.

You can always try 'service plugin status', I have it read the output of 'ps aux' and find the plugin's user and the Plugin in questions and either tell you the pid_number or that the plugin is off.

The great part about these jails is just nuking them and starting from scratch. I use protosd's video for creating the plugin jail through the gui and have never had a problem, FreeNAS has docs for this now as well.

Goodluck
 
Status
Not open for further replies.
Top