Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Support for the freeBSD package, created by dbrooks
dbrooks
Newbie
Newbie
Posts: 19
Joined: June 23rd, 2011, 11:19 pm

Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by dbrooks »

Hey folks,

Some time ago, I noticed that the SABnzbd+ versions included in the ports tree on FreeBSD (affectionately referenced as news/sabnzbdplus) were falling behind.  I took some steps to get this jumpstarted into 0.5.x land, and eventually took it over myself for 0.6.0+ versions, and I'm doing my best to keep it current for everybody to enjoy.  I feel like the FreeBSD port doesn't get enough love on the Wiki and the forums.  I'd love to add an installation page to the Wiki for FreeBSD (and probably other *BSDs, if there are news/sabnzbdplus maintainers for OpenBSD and NetBSD, though I haven't checked), but of course I can't edit it myself.  

I figured I'd start this thread to let folks know that SABnzbd+ is indeed well supported on FreeBSD, and I'm doing my best to keep it updated in the ports tree.  I may fall behind on occasion, but I usually get some users who email me and ask what's up if I haven't updated the port in a while after a new release, and I do my best to make it a snappy turnaround.

Installation on FreeBSD is easy-peasy:

Code: Select all

cd /usr/ports/news/sabnzbdplus && make install
Alternatively, some time after the port is committed, you should be able to install the package directly with pkg_add:

Code: Select all

pkg_add -r sabnzbdplus

If you're upgrading, make sure that you stop the service first.  Additionally, I like to uninstall the previous version:

Code: Select all

/usr/local/etc/rc.d/sabnzbd onestop
cd /usr/ports/news/sabnzbdplus && make install
(you could also substitute pkg_add here)


SABnzbd+ on FreeBSD is also fully compliant with /etc/rc.conf so you can start the service on boot:

Code: Select all

echo 'sabnzbdplus_enable="YES"' >> /etc/rc.conf

Make sure you're keeping your ports tree up-to-date with portsnap so you get all the latest sabnzbdplus love!  Quick docs on using portsnap to accomplish this here: http://www.freebsd.org/doc/handbook/portsnap.html.

I've just submitted the port update for 0.6.5 as I write this, so it should be committed and ready to install soon.  I try to provide a complete installation on FreeBSD -- SABnzbd+ runs under its own user and group (_sabnzbd:_sabnzbd), provides a fully rc.conf-compliant installation, and holds all downloads and configuration in /usr/local/sabnzbd by default.  Get to installing!  If you have any questions, feel free to post them to this thread or shoot me a PM/email since I may not check back here in a timely fashion (though I do plan to check back).

Thanks!  ;D
dbrooks
Newbie
Newbie
Posts: 19
Joined: June 23rd, 2011, 11:19 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by dbrooks »

FYI, 0.6.9 is awaiting commit, and fixes a couple things:

1) uses the included cherrypy vs any cherrypy that may be installed via ports (or manually), which corrects a GUI bug that doesn't allow you to manually upload NZBs via the web interface,

2) Updated rc.d script that uses SABzbd's built-in "--daemon" functionality instead of /usr/bin/daemon, and plays nicer with rc.conf.

Highly advised you move to 0.6.9 (once committed) before reporting any issues.
xgalaxy
Newbie
Newbie
Posts: 4
Joined: September 21st, 2011, 7:27 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by xgalaxy »

Hey.

I registered just to say THANK YOU.

It's too bad 0.6.9 hasn't hit the ports tree yet. I can't wait for the update.

Only problem I have currently with sabnzdb on freebsd at the moment is it has trouble finding the unzip tools, par2, etc. The only way I've found to fix this problem is to export the PATH in the rc.conf file with the added /usr/local/bin path (yuck). Any thoughts on that?
dbrooks
Newbie
Newbie
Posts: 19
Joined: June 23rd, 2011, 11:19 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by dbrooks »

Thanks for the feedback. I'm not sure what the holdup on getting 0.6.9 committed is. If you're feeling lucky and want the port ahead of it being committed, you can visit the PR here: http://www.freebsd.org/cgi/query-pr.cgi?pr=160710

Download the diff I supplied at the bottom of the thread (not the original one near the top!)

Update your ports tree. I prefer portsnap:

Code: Select all

# portsnap update
Uninstall any installed version (backup your configuration files first -- shouldn't have to, but better safe than sorry):

Code: Select all

# /usr/local/etc/rc.d/sabnzbd onestop
# pkg_info | grep sabnzbdplus | awk '{print $1}' | xargs pkg_delete
Patch the existing port with the diff (assuming you called your diff /tmp/sabnzbdplus-0.6.9.diff):

Code: Select all

# cd /usr/ports/news/sabnzbdplus
# make clean
# patch -p1 < /tmp/sabnzbdplus-0.6.9.diff
If everything patched up correctly, you can build the new port and fire it up:

Code: Select all

# make install
# /usr/local/etc/rc.d/sabnzbd onestart
As far as the path problems you're having, I'm not totally sure. I don't seem to have the issue on my system, but /usr/local/bin should always be in the $PATH variable for FreeBSD systems (in general). SABnzbd.py calls a module called "newsunpack" from its own module, which in turn references a function called "find_on_path" which effectively is this:

Code: Select all

def find_on_path(targets):
    """ Search the PATH for a program and return full path """
    if sabnzbd.WIN32:
        paths = os.getenv('PATH').split(';')
    else:
        paths = os.getenv('PATH').split(':')
It's just looking at the $PATH environment variable and splitting it on the ":" characters. If /usr/local/bin isn't in there, it likely won't find your external tools. Is /usr/local/bin in the $PATH for other users on your system by default?

Make sure you're starting sabnzbd with the provided init script in /usr/local/etc/rc.d, and that the _sabnzbd user exists on your system and that the process is running as that user. Also, be sure that the permissions on /usr/local/bin wouldn't be restrictive of the _sabnzbd user (should be root:wheel and 0755).


Bonus tip: try installing archivers/par2cmdline-tbb instead of archivers/par2cmdline for multi-threaded par2 operations (makes repair and assembly considerably faster if you have more than one CPU core at your disposal)
xgalaxy
Newbie
Newbie
Posts: 4
Joined: September 21st, 2011, 7:27 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by xgalaxy »

Sorry I'm still fairly new with freebsd.
I use portmanager to manage my ports and it doesn't like it when I replace par2cmdline with par2cmdline-tbb.
It says they conflict, so when I remove the non-tbb version it will finally install par2cmdlind-tbb but then it says that sabnzbd does not have the proper dependencies installed.

Any help would be appreciated.

PS.
I noticed some ports bring up an option dialog and ask you to select between versions of dependencies, and also a few other options. And portmanager seems to behave with these. Perhaps an option dialog could be created for the sabnzdb port allowing you to select the tbb dependency instead? Not that I mean to put more work on you :D
dbrooks
Newbie
Newbie
Posts: 19
Joined: June 23rd, 2011, 11:19 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by dbrooks »

You're right, I think I'll need to change the Makefile to include par2cmdline-tbb as a recognized option. You could edit it yourself and change the line that looks like:

Code: Select all

RUN_DEPENDS+= par2repair:${PORTSDIR}/archivers/par2cmdline
to read:

Code: Select all

RUN_DEPENDS+= par2repair:${PORTSDIR}/archivers/par2cmdline-tbb
...and rebuild the package (no guarantees on that, it's just a quick suggestion). I'll look into making par2cmdline-tbb an accepted option in the next port release (probably whenever SABnzbd+ 0.7.0 is released, or if there's an 0.6.10 version)
xgalaxy
Newbie
Newbie
Posts: 4
Joined: September 21st, 2011, 7:27 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by xgalaxy »

Awesome!
Thank you for the quick replies!
Placemaster
Newbie
Newbie
Posts: 19
Joined: July 1st, 2010, 2:10 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by Placemaster »

Hi,

I am trying to install sabnzbd+ on Freenas full 0.7.2 but am not successful.

Previous install worked well.
When trying to install the packages with : pkg_add -r sabnzbdplus
I get : Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports ... bdplus.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports ... bdplus.tbz' by URL

So I don't know what to do. Can you help me out.
It would be great!
dbrooks
Newbie
Newbie
Posts: 19
Joined: June 23rd, 2011, 11:19 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by dbrooks »

Unfortunately, I have no visibility into when ports are built as packages and provided on the FTP site. However, I suspect that no new ports are actively being added into the old FreeBSD 7.3 tree. FreeNAS 8.0+ (assuming it's built against the FreeBSD source of the same version) may have a different result, but I can't guarantee anything.

I highly suggest you build from ports directly, and not use pkg_add.
syah
Newbie
Newbie
Posts: 1
Joined: December 23rd, 2011, 9:19 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by syah »

Thanks for the awesome work dbrooks!

Just jumped into usenet readers for a project a week ago, and sabnzbd+ on FreeBSD 8.2 works like a charm!
dbrooks
Newbie
Newbie
Posts: 19
Joined: June 23rd, 2011, 11:19 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by dbrooks »

Glad to hear it!
bunjiboys
Newbie
Newbie
Posts: 6
Joined: January 2nd, 2012, 1:25 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by bunjiboys »

Hi dbrooks,

Apologies for necroing older parts of the thread, but I wanted to just touch back on the PATH issues that were mentioned earlier in the thread as well. I have noticed the same issue, where if sabnzbd is started by the RC system during bootup, the PATH does not contain /usr/local/bin (/etc/rc only has "PATH=/sbin:/bin:/usr/sbin:/usr/bin"), causing the warnings about not being able to find unzip, rar, par2 etc.

However, if you run the RC script manually, it will adopt your shells PATH and environment and thus be able to find it, meaning that the work around is to simply run '/usr/local/etc/rc.d/sabnzbd restart' manually, but that kinda defeats the purpose of having the automatic startup there in the first place. I think the nicest way to fix this may be to simply overwrite the PATH in the supplied RC script, and just add /usr/local/bin to it, as editing /etc/rc.conf or similar global configuration files is over the top and may even cause unexpected behaviour from some other systems.

Other than that, I too would like to extend my gratitude for you picking up the ball and keeping the port up to date :)
dbrooks
Newbie
Newbie
Posts: 19
Joined: June 23rd, 2011, 11:19 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by dbrooks »

You may be right -- I'll do some research. I believe I had another report of a similar problem via email recently, so I'll see if I can replicate it on my end (should be easy), and if I can, I'll fix the script. I may not bother making a new port revision just for the init script, however, since it seems like 0.6.x releases have been coming out pretty steady from Shypike. It may make more sense for me to just roll the init script update into the next port revision containing the next version of SABnzbd+.

Thanks for the heads up
User avatar
corvaxmuzzy
Newbie
Newbie
Posts: 6
Joined: January 1st, 2012, 10:58 pm

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by corvaxmuzzy »

dbrooks,
I am glad that I have the opportunity to thank you for the FreeBSD work. Thank you.

All the best,
Jaime
nicol88
Newbie
Newbie
Posts: 1
Joined: April 16th, 2012, 2:35 am

Re: Hi, I'm the port maintainer for SABnzbd+ on FreeBSD!

Post by nicol88 »

Thanks for letting me know about other good stuff! Thank you very much for your work and keep up
Post Reply