Page 1 of 1

host = :: on Fedora versus Ubuntu (Linux)

Posted: March 13th, 2012, 11:29 am
by sander
On my Ubuntu, filling out '::' as listening host results in SAB starting with :: and listening on IPv6 (and IPv4). Good

On my Fedora Core 14 (on emulated ARM), the '::' results in SAB starting up with 0.0.0.0 and only listening on IPv4. That's not what I want; it should be listening on IPv6.

Both systems have IPv6 enabled. Both systems run Python 2.7.

If anybody can test this on his/her Fedora, or has tips, please let me know.


Ubuntu on x86:

Code: Select all

sander@R540:~/SABnzbd-0.6.15$ grep host ~/.sabnzbd/sabnzbd.ini
host = ::
host = newszilla6.xs4all.nl
host = newsreader3.eweka.nl
host = reader.ipv6.xsnews.nl
host = free.xsusenet.com
host = weathergirl-ipv6.tele2.net
host = news.free.fr
host = news.readfreenews.net
sander@R540:~/SABnzbd-0.6.15$ 


sander@R540:~/SABnzbd-0.6.15$ 
sander@R540:~/SABnzbd-0.6.15$ ./SABnzbd.py 
2012-03-13 17:21:42,373::INFO::[SABnzbd:1207] --------------------------------
2012-03-13 17:21:42,401::INFO::[SABnzbd:1208] SABnzbd.py-0.6.15 (rev=d06f957a0f05a8766822acaa6de1f6d1e9f279e0)
2012-03-13 17:21:42,401::INFO::[SABnzbd:1220] Platform = posix
2012-03-13 17:21:42,402::INFO::[SABnzbd:1221] Python-version = 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1]
2012-03-13 17:21:42,402::INFO::[SABnzbd:1222] Arguments = "./SABnzbd.py"
2012-03-13 17:21:42,403::INFO::[SABnzbd:1235] Read INI file /home/sander/.sabnzbd/sabnzbd.ini
2012-03-13 17:21:42,407::INFO::[__init__:870] Loading data for bookmarks.sab from /home/sander/.sabnzbd/admin/bookmarks.sab
2012-03-13 17:21:42,428::INFO::[__init__:870] Loading data for rss_data.sab from /home/sander/.sabnzbd/admin/rss_data.sab
2012-03-13 17:21:42,429::INFO::[__init__:870] Loading data for totals9.sab from /home/sander/.sabnzbd/admin/totals9.sab
2012-03-13 17:21:42,429::INFO::[postproc:89] Loading postproc queue
2012-03-13 17:21:42,430::INFO::[__init__:870] Loading data for postproc1.sab from /home/sander/.sabnzbd/admin/postproc1.sab
2012-03-13 17:21:42,431::INFO::[__init__:870] Loading data for queue9.sab from /home/sander/.sabnzbd/admin/queue9.sab
2012-03-13 17:21:42,432::DEBUG::[downloader:110] Initializing downloader/decoder
2012-03-13 17:21:42,433::INFO::[__init__:870] Loading data for watched_data.sab from /home/sander/.sabnzbd/admin/watched_data.sab
2012-03-13 17:21:42,434::DEBUG::[scheduler:136] Scheduling RSS interval task every 60 min (delay=10)
2012-03-13 17:21:42,434::DEBUG::[scheduler:147] Scheduling VersionCheck on day 7 at 2:19
2012-03-13 17:21:42,435::DEBUG::[scheduler:155] Scheduling Bookmark interval task every 60 min (delay=58)
2012-03-13 17:21:42,435::INFO::[downloader:194] Resuming
2012-03-13 17:21:42,436::DEBUG::[__init__:479] PAUSED_ALL inactive
2012-03-13 17:21:42,436::INFO::[__init__:289] All processes started
2012-03-13 17:21:42,436::INFO::[SABnzbd:331] Web dir is /home/sander/SABnzbd-0.6.15/interfaces/Plush
2012-03-13 17:21:42,456::INFO::[SABnzbd:331] Web dir is /home/sander/SABnzbd-0.6.15/interfaces/smpl
2012-03-13 17:21:42,483::INFO::[SABnzbd:454] _yenc module... found!
2012-03-13 17:21:42,483::INFO::[SABnzbd:462] par2 binary... found (/usr/bin/par2)
2012-03-13 17:21:42,483::INFO::[SABnzbd:470] unrar binary... found (/usr/bin/unrar)
2012-03-13 17:21:42,484::INFO::[SABnzbd:475] unzip binary... found (/usr/bin/unzip)
2012-03-13 17:21:42,484::INFO::[SABnzbd:481] nice binary... found (/usr/bin/nice)
2012-03-13 17:21:42,485::INFO::[SABnzbd:485] ionice binary... found (/usr/bin/ionice)
2012-03-13 17:21:42,485::INFO::[SABnzbd:490] pyOpenSSL... found (True)
2012-03-13 17:21:42,487::INFO::[SABnzbd:1402] Starting web-interface on :::8080
[13/Mar/2012:17:21:42] ENGINE Bus STARTING
2012-03-13 17:21:42,488::INFO::[_cplogging:55] [13/Mar/2012:17:21:42] ENGINE Bus STARTING
[13/Mar/2012:17:21:42] ENGINE Started monitor thread '_TimeoutMonitor'.
2012-03-13 17:21:42,529::INFO::[_cplogging:55] [13/Mar/2012:17:21:42] ENGINE Started monitor thread '_TimeoutMonitor'.
[13/Mar/2012:17:21:42] ENGINE Serving on :::8080
2012-03-13 17:21:42,632::INFO::[_cplogging:55] [13/Mar/2012:17:21:42] ENGINE Serving on :::8080
[13/Mar/2012:17:21:42] ENGINE Bus STARTED
2012-03-13 17:21:42,634::INFO::[_cplogging:55] [13/Mar/2012:17:21:42] ENGINE Bus STARTED
So: ENGINE Serving on :::8080


Fedora Core on (emulated) ARM:

Code: Select all

[sander@raspi ~]$ !grep
grep host .sabnzbd/sabnzbd.ini
host = ::
host = newszilla6.xs4all.nl

[sander@raspi ~]$ 
[sander@raspi ~]$ SABnzbd 
2012-03-13 17:20:32,509::INFO::[SABnzbd:1207] --------------------------------
2012-03-13 17:20:32,521::INFO::[SABnzbd:1208] SABnzbd.py-0.6.15 (rev=d06f957a0f05a8766822acaa6de1f6d1e9f279e0)
2012-03-13 17:20:32,529::INFO::[SABnzbd:1220] Platform = posix
2012-03-13 17:20:32,536::INFO::[SABnzbd:1221] Python-version = 2.7 (r27:82500, May 23 2011, 09:08:29) 
[GCC 4.5.1 20100924 (Red Hat 4.5.1-4)]
2012-03-13 17:20:32,542::INFO::[SABnzbd:1222] Arguments = "./SABnzbd.py"
2012-03-13 17:20:32,549::INFO::[SABnzbd:1235] Read INI file /home/sander/.sabnzbd/sabnzbd.ini
2012-03-13 17:20:32,634::INFO::[__init__:870] Loading data for bookmarks.sab from /home/sander/.sabnzbd/admin/bookmarks.sab
2012-03-13 17:20:32,646::INFO::[__init__:870] Loading data for rss_data.sab from /home/sander/.sabnzbd/admin/rss_data.sab
2012-03-13 17:20:32,656::INFO::[__init__:870] Loading data for totals9.sab from /home/sander/.sabnzbd/admin/totals9.sab
2012-03-13 17:20:32,663::INFO::[__init__:873] /home/sander/.sabnzbd/admin/totals9.sab missing, trying old cache
2012-03-13 17:20:32,673::INFO::[__init__:876] /home/sander/.sabnzbd/cache/totals9.sab missing
2012-03-13 17:20:32,862::INFO::[postproc:89] Loading postproc queue
2012-03-13 17:20:32,871::INFO::[__init__:870] Loading data for postproc1.sab from /home/sander/.sabnzbd/admin/postproc1.sab
2012-03-13 17:20:32,884::INFO::[__init__:870] Loading data for queue9.sab from /home/sander/.sabnzbd/admin/queue9.sab
2012-03-13 17:20:32,915::INFO::[__init__:870] Loading data for watched_data.sab from /home/sander/.sabnzbd/admin/watched_data.sab
2012-03-13 17:20:32,940::INFO::[downloader:194] Resuming
2012-03-13 17:20:32,948::INFO::[__init__:289] All processes started
2012-03-13 17:20:32,957::INFO::[SABnzbd:331] Web dir is /usr/share/SABnzbd/interfaces/Plush
2012-03-13 17:20:33,129::INFO::[SABnzbd:454] _yenc module... found!
2012-03-13 17:20:33,136::INFO::[SABnzbd:462] par2 binary... found (/usr/bin/par2)
2012-03-13 17:20:33,143::INFO::[SABnzbd:470] unrar binary... found (/usr/bin/unrar)
2012-03-13 17:20:33,150::INFO::[SABnzbd:475] unzip binary... found (/usr/bin/unzip)
2012-03-13 17:20:33,157::INFO::[SABnzbd:481] nice binary... found (/bin/nice)
2012-03-13 17:20:33,164::INFO::[SABnzbd:485] ionice binary... found (/usr/bin/ionice)
2012-03-13 17:20:33,171::INFO::[SABnzbd:490] pyOpenSSL... found (True)
2012-03-13 17:20:33,202::INFO::[SABnzbd:1402] Starting web-interface on 0.0.0.0:8080
2012-03-13 17:20:33,219::INFO::[_cplogging:55] [13/Mar/2012:17:20:33] ENGINE Bus STARTING
2012-03-13 17:20:33,289::INFO::[_cplogging:55] [13/Mar/2012:17:20:33] ENGINE Started monitor thread '_TimeoutMonitor'.
2012-03-13 17:20:33,550::INFO::[_cplogging:55] [13/Mar/2012:17:20:33] ENGINE Serving on 0.0.0.0:8080
2012-03-13 17:20:33,561::INFO::[_cplogging:55] [13/Mar/2012:17:20:33] ENGINE Bus STARTED
So: ENGINE Serving on 0.0.0.0:8080

Tip appreciated.

Re: host = :: on Fedora versus Ubuntu (Linux)

Posted: March 13th, 2012, 5:12 pm
by sander
Update:

A friend of mine tested the :: setting on Fedora Core 16 on x86, and that works as with Ubuntu: correct listening on IPv6.

So, difference between the two Fedora's: version 14 versus 16, and ARM versus x86. And possibly other things, like /etc/hosts or python resolving stuff ... ? Maybe I have to dive into the SAB code that leads to the "[SABnzbd:1402] Starting web-interface on :::9090"...

Code: Select all

2012-03-13 22:51:58,731::INFO::[SABnzbd:1207] --------------------------------
2012-03-13 22:51:58,731::INFO::[SABnzbd:1208] SABnzbd.py-0.6.15 (rev=d06f957a0f05a8766822acaa6de1f6d1e9f279e0)
2012-03-13 22:51:58,732::INFO::[SABnzbd:1220] Platform = posix
2012-03-13 22:51:58,732::INFO::[SABnzbd:1221] Python-version = 2.7.2 (default, Oct 27 2011, 01:40:22)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)]
2012-03-13 22:51:58,732::INFO::[SABnzbd:1222] Arguments = "/usr/share/SABnzbd/SABnzbd.py", "-d", "-f", "/home/svenh/.sabnzbd/sabnzbd.ini"
2012-03-13 22:51:58,733::INFO::[SABnzbd:1235] Read INI file /home/svenh/.sabnzbd/sabnzbd.ini
2012-03-13 22:51:58,739::INFO::[__init__:870] Loading data for bookmarks.sab from /home/svenh/.sabnzbd/admin/bookmarks.sab
2012-03-13 22:51:58,740::INFO::[__init__:870] Loading data for rss_data.sab from /home/svenh/.sabnzbd/admin/rss_data.sab
2012-03-13 22:51:58,741::INFO::[__init__:870] Loading data for totals9.sab from /home/svenh/.sabnzbd/admin/totals9.sab
2012-03-13 22:51:58,741::INFO::[postproc:89] Loading postproc queue
2012-03-13 22:51:58,742::INFO::[__init__:870] Loading data for postproc1.sab from /home/svenh/.sabnzbd/admin/postproc1.sab
2012-03-13 22:51:58,743::INFO::[__init__:870] Loading data for queue9.sab from /home/svenh/.sabnzbd/admin/queue9.sab
2012-03-13 22:51:58,745::INFO::[__init__:870] Loading data for watched_data.sab from /home/svenh/.sabnzbd/admin/watched_data.sab
2012-03-13 22:51:58,747::INFO::[downloader:194] Resuming
2012-03-13 22:51:58,748::INFO::[__init__:289] All processes started
2012-03-13 22:51:58,748::INFO::[SABnzbd:331] Web dir is /usr/share/SABnzbd/interfaces/smpl
2012-03-13 22:51:58,815::INFO::[SABnzbd:454] _yenc module... found!
2012-03-13 22:51:58,816::INFO::[SABnzbd:462] par2 binary... found (/usr/bin/par2)
2012-03-13 22:51:58,816::INFO::[SABnzbd:470] unrar binary... found (/usr/bin/unrar)
2012-03-13 22:51:58,816::INFO::[SABnzbd:475] unzip binary... found (/usr/bin/unzip)
2012-03-13 22:51:58,817::INFO::[SABnzbd:481] nice binary... found (/bin/nice)
2012-03-13 22:51:58,817::INFO::[SABnzbd:485] ionice binary... found (/usr/bin/ionice)
2012-03-13 22:51:58,817::INFO::[SABnzbd:490] pyOpenSSL... found (True)
2012-03-13 22:51:58,829::INFO::[SABnzbd:1402] Starting web-interface on :::9090
2012-03-13 22:51:58,831::INFO::[_cplogging:55] [13/Mar/2012:22:51:58] ENGINE Bus STARTING
2012-03-13 22:51:58,849::INFO::[_cplogging:55] [13/Mar/2012:22:51:58] ENGINE Started monitor thread '_TimeoutMonitor'.
2012-03-13 22:51:59,054::INFO::[_cplogging:55] [13/Mar/2012:22:51:59] ENGINE Serving on :::8080
2012-03-13 22:51:59,159::INFO::[_cplogging:55] [13/Mar/2012:22:51:59] ENGINE Serving on :::9090
2012-03-13 22:51:59,161::INFO::[_cplogging:55] [13/Mar/2012:22:51:59] ENGINE Bus STARTED
2012-03-13 22:51:59,585::INFO::[SABnzbd:1471] Starting SABnzbd.py-0.6.15
2012-03-13 22:51:59,591::INFO::[dirscanner:263] Dirscanner starting up
2012-03-13 22:51:59,593::INFO::[urlgrabber:75] URLGrabber starting up

Re: host = :: on Fedora versus Ubuntu (Linux)

Posted: March 13th, 2012, 5:53 pm
by sander
Did some tracing, and this piece of code of SABnzbd.py changes the cherryhost value from :: to 0.0.0.0:

Code: Select all

    ipv4 = ipv6 = False
    localhost = hostip = 'localhost'
    try:
        info = socket.getaddrinfo(socket.gethostname(), None)
    except:
        # Hostname does not resolve, use 0.0.0.0
        cherryhost = '0.0.0.0'
So let's try that socket.getaddr ...:

Code: Select all

[sander@raspi ~]$ python 
Python 2.7 (r27:82500, May 23 2011, 09:08:29) 
[GCC 4.5.1 20100924 (Red Hat 4.5.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import socket

>>> socket.gethostname()
'raspi'
>>> 

>>> info = socket.getaddrinfo(socket.gethostname(), None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.gaierror: [Errno -2] Name or service not known
>>> 
Hmm, doesn't look good. Did some googling, and http://stackoverflow.com/questions/3260 ... dentical-o suggests /etc/hosts is missing the entry for its own name. So added

127.0.1.1 raspi

to /etc/hosts, and the above error is gone.

I still have to check SABnzbd itself, but my battery is running out ... more later on ...

Re: host = :: on Fedora versus Ubuntu (Linux)

Posted: March 14th, 2012, 6:12 am
by sander
OK, SAB now works too!

I'm still wondering about the meaning of the code:

Code: Select all

    # Get IP address, but discard APIPA/IPV6
    # If only APIPA's or IPV6 are found, fall back to localhost
    ipv4 = ipv6 = False
    localhost = hostip = 'localhost'
    try:
        info = socket.getaddrinfo(socket.gethostname(), None)
    except:
        # Hostname does not resolve, use 0.0.0.0
        cherryhost = '0.0.0.0'
        info = socket.getaddrinfo(localhost, None)

    for item in info:
        ip = str(item[4][0])
        if ip.startswith('169.254.'):
            pass # Is an APIPA
        elif ':' in ip:
            ipv6 = True
        elif '.' in ip and not ipv4:
            ipv4 = True
            hostip = ip
So: "if hostname does not resolve, use cherryhost = 0.0.0.0 instead". Why 0.0.0.0, and not 127.0.0.1, or ::, or ... ? Why give cherryhost another value at all?

Re: host = :: on Fedora versus Ubuntu (Linux)

Posted: March 14th, 2012, 6:45 am
by shypike
Because this piece of code runs when the user doesn't want to use localhost.

Re: host = :: on Fedora versus Ubuntu (Linux)

Posted: March 14th, 2012, 7:09 am
by sander
shypike wrote:Because this piece of code runs when the user doesn't want to use localhost.
OK, clear. Thanks.