Howto: NZBGet on a Qnap NAS

Posted on Sun 06/14/09 in NZBGet

How to get NZBGet up and running on a Qnap NAS device and start as a daemon at boot time.

I made the move and got myself a Qnap TS-439 Pro NAS to replace my ol’ FreeBSD server (which has now been transformed to a FreeBSD desktop). The Qnap NAS devices support so-called QPKG packages, which are all-in-one packages for an application or daemon, containing all required files.

By default, the only supported NNTP daemon for the Qnap devices is the excellent SABnzbd. SAB has a big disatvantage, though: on these low-powered NAS devices it becomes a resource hog. Even on my TS-439, which comes with 1G ram and a 1.6GHz Atom, download speeds were fluctuating and the process ate 100% at many occasions.

In the “beta corner” of the Qnap forums, some people were playing with NZBGet, an old love of mine, being the first NNTP daemon I ever used. Contrary to SABnzbd, NZBGet focusses on performance and consumes few resources. Qnap provides a beta QPKG of NZBGet, but it contains the “ancient” v0.4.0 and is not suitable for my TS-439 model. So, I had a go at installing it myself, with success! Here’s the how to (mostly a straight copy from my post on the Qnap forums, but it never hurts to mirror ;-)):

Scenario:

  • Freshly installed 3.1 firmware
  • No QPKGs installed

Steps:

1) Install the Optware QPKG.

2) Log on to the server using SSH.

3) Edit the config file. In RAID setup, you can find it at

/share/MD0_DATA/.qpkg/Optware/etc/ipkg.conf

In a single disk setup, it can be found at

/share/HDA_DATA/.qpkg/Optware/etc/ipkg.conf

I’ll be using the RAID setup path from this point on. Replace MD0_DATA where necessary.

4) Add the following before the dest root / part:

src cs05q1armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/stable

5) Run ipkg update

6) Install nzbget: ipkg install nzbget

Also, install unrar: ,code>ipkg install unrar. I found out the hard way it was missing ;-)

7) Copy the example config file /share/MD0_DATA/.qpkg/Optware/share/doc/nzbget/nzbget.conf.example to, for example, /opt/etc/nzbget.conf and edit it to your liking.

Please do take your time editing. Especially the Par settings and performance notes (at the bottom of the file) can increase performance.

8) In this config file you have set some directories. You should create those and make them writable (chmod 777 is what seems common when looking at the sabnzbd qpkg actions). In my case, the list is:

/share/MD0_DATA/Qdownload/nzbget
/share/MD0_DATA/Qdownload/nzbget/dst
/share/MD0_DATA/Qdownload/nzbget/nzb
/share/MD0_DATA/Qdownload/nzbget/queue
/share/MD0_DATA/Qdownload/nzbget/tmp

9) Fetch the NZBGet web interface from the NZBGet forum

10) Copy it to your Qweb folder and unzip it. Easy copy paste commands:

cd /share/MD0_DATA/Qweb/
wget http://kent.dl.sourceforge.net/sourceforge/nzbget/nzbgetweb-1.3.zip
unzip nzbgetweb-1.3.zip

11) If you want it for a root directory, remove all files and directories, except the nzbgetweb directory, and then move all files from the nzbgetweb directory to the Qweb root. Remove the nzbgetweb directory afterwards.

12) Mount your autorun.sh partition (For instructions, see the Qnap wiki)

13) Edit / create the autorun.sh file in the partition and add this line:

/opt/bin/nzbget -c /opt/etc/nzbget.conf -D

Replace the nzbget.conf path with your own if you used a different one. This should autostart NZBGet when (re)starting the machine. Please note I have not yet tested this. I tried creating my own init.d scripts, but they were deleted after a reboot due to the root drive being a temporary one. Also note that NZBGet is not gracefully shutdown upon reboot/shutdown, so I don’t know how it will respond to that when it’s in the middle of repairing/unpacking. I’d love to hear from others regarding this. Otherwise I’ll just have to test it ;-)

14) Run the command you added to the autorun.sh to start the NZBGet daemon

15) Make sure you have your webservice running in your control panel.

16) Navigate to the web interface. Tadah, you should see the NZBGet web ui.

17) If you set a password in your NZBGet config file, make sure to set it in the Config > COMMUNICATION WITH NZBGET-SERVER > ServerPassword field. Same goes for other vital settings, if you set any.

18) Optionally, you can set some configuration stuff in the web ui so you can easily edit your own config file and set login requirements for the web gui. To force a login, enter a user name and password in the LOGIN-SCREEN section. If you wish to edit your daemon configuration from the web UI, point the ServerConfigFile to your nzbget.conf file, and ServerConfigTemplate to the original nzbget.conf.example file.

19) Postprocessing: I myself use the example file from /share/MD0_DATA/.qpkg/Optware/share/doc/nzbget/postprocess-example.sh. Copy it to, f.e., /opt/bin/NZBGET_postprocess.sh, chmod +x it and edit it to your liking. You can manipulate the file in the web UI the same way as the config file, if you set the paths correctly

Okay, I think that’s the whole shebang. I’m very pleased with the result myself. NZBGet always downloads at full speed for me and doesn’t eat all of my resources. Its GUI may not be top notch like SABnzbd’s, but I can live with that. I can always extend it since it’s PHP ;-)

I hope this little guide will be of some help to someone. If you have questions or are experiencing problems, you can always reply here. I won’t guarantee I can help you, but if I can, I will.

For reference sake, a link to my forum post.



Comment

Did you manage to make it autorun ?
There is no answer on your forum post

— kesasar · Jul 18, 11:23 AM · #

I replied to your post on the QNAP forum. Basically, I use the new 0.6.0 QPKG. Perhaps if a newer version hits IPKG I’ll look into the autostart again.

— jurrie · Jul 23, 05:48 PM · #

For what it is worth, my Qnap barely breaks a sweat. I have a TS-509 (which replaced my FreeNAS) and I’m streaming a 1080p rip to my TViX player, streaming music (via add-on SqueezeCenter) to the Slim upstairs, capturing video from three network cameras to the Surveillance Station, and sucking down binaries via SABnzbd, all using 3.7% CPU or less. And the myNZB and iPeng apps for the iPhone make everything all that much more integrated and accessible.

I am completely happy with this addition to my home AV LAN.

REF: Qnap ver 3.1.1 Build 0815T, SqueezeCenter ver 7.3.4-28402, SABnzbd+ ver 0.4.11.

-Nick

— nnsten · Oct 11, 08:18 PM · #

I had my thoughts on buying a QNAP and go with torrents and some sort of secure vpn(Anonymizer) but seems like too much trouble so I was wondering if this app is all you need to get started with with using usenets. Or how many extra apps do you need(searching for nzb files etc? Not used usenets before. Will a QNAP ts-209 do the trick? What can the user interface do?

— Todilo · Oct 30, 05:04 PM · #

You’re better off on the QNAP forums with that question :-) And for a usenet explanation, there are plenty of websites out there with info, just google them. By default, QNAP supports torrents, and for an easy usenet setup, you can always use their SABnzbd package. It just didn’t cut it for me with the high loads it caused at 4MB/sec.

jurrie · Oct 30, 06:17 PM · #

I’m going to try out the latest SABnzbd on my TS-419. On extreme load – i’ll work through this post.

Thank you for posting this great info – appreciated & bookmarked!!

— glide · Jan 14, 02:52 PM · #