Adblock support thread

I encountered the same when I upgraded to 2.6.2.
Please check that the adblock "symlink" in /etc/rc.d directory is S50adblock instead of the old S90adblock

root@LEDE:/etc/rc.d# ls /etc/rc.d/*ad*
/etc/rc.d/S50adblock

You may also try to fix it by disabling and enabling the adblock system service by running:

  /etc/init.d/adblock disable
  /etc/init.d/adblock enable

EDIT:
Ahh, dibdot wrote the same while I was writing this.

thank you!! re-enabling fixed the issue! it's processing and keeping me away from ads :slight_smile:

I see something strange:

status          : active
adblock_version : 2.6.2
blocked_domains : 317841

but

cat /etc/adblock/adblock.blacklist | wc -l
620712

and

 cat /tmp/dnsmasq.d/adb_list.blacklist | wc -l
204096

It looks like adblock.blacklist is processed partially.
Log shows:

Mon May  1 20:30:13 2017 user.notice adblock-[2.6.2] debug: name: blacklist, enabled: 1, backup: 1, dns: dnsmasq, fetch: wget (built-in), memory: 478716, force srt/dns: 1/0
Mon May  1 20:32:04 2017 user.notice adblock-[2.6.2] debug: name: blacklist, mode: backup, count: 247909, in_rc: 0, out_rc: 0

Previously I used build older - 2.3.0 - and all records were loaded properly (~670 000, all lists and my blacklist). Problem started with version 2.4.
What could be a reason of such behaviour?

Not a bug, it's a feature ... :slight_smile:
It's called top level domain compression, for details see here Adblock support thread - #62 by dibdot

Oh, I see... Do You plan option for disable this feature? Sometimes ad server is in legit domain that should be viewed and 10MB is not a culprit if You have to manually add hundreds whitelist entries (it will work, right? :wink: )
But a little suggestion: move white and blacklist editing tabs on right and place Query tab as first in Advanced.

  1. If something goes wrong You first look for blocked domain
  2. browser never load a few hundreds thousands lines on blacklist when You switch on Advanced tab :slight_smile:

No, TLD compression only compress when the top domain is in the list of blocked domains.[quote="Wally, post:106, topic:507"]
2) browser never load a few hundreds thousands lines on blacklist when You switch on Advanced tab :slight_smile:
[/quote]
you're are running a "very special" adblock setup ... maybe I should load black-/whitelist entries only partially in LuCI ...:wink:

You got it wrong. The feature removes unnecessary subdomains from the list if the top domain is also on the list by itself.

@dibdot, @hnyman, thanks for clarification.

What interface should adblock be triggered off if I have a PPPoE connection? The default is "wan" but I also have "pppoe-wan". Thx in advance.

Did adblock not start with 'wan' trigger? If not, check available interfaces with ...

ubus list

... and add the relevant interface.

I'm on 17.0.1 lede release and adblock 2.6.1 was just backported.
There are no extra options with the luci-app-adblock page.
Could you provide direction, by chance?

adblock 2.6.2 was backported to latest LEDE stable release. Did you already reset your luci caches?
If not, please try the following:

/etc/init.d/uhttpd stop
rm -f /tmp/luci-indexcache
rm -rf /tmp/luci-modulecache
/etc/init.d/uhttpd start

1 Like

That output has only "wan" and "wan6", but no "pppoe-wan". I guess I have to use "wan" in my case. adblock page reports that it is running,

I have been using this for a very long time and I am so happy withit. Lately I set it up for a friend of mine who has a teenagers and he wanted to block adult sites. Everything works perfect however, it is a bit slow resolving domains. the number of block list is a bit more than 1 million. What do you guys suggest I should do?

Takes 3 minutes for the adblock to activate.

Thanks in advance

Don't get me wrong, but personally I would try to find a "non-technical" solution, talk with the kids/teenagers ... you can't block half of the internet on your box.

If you really need this huge amount of blocked domains, try things like that:

  1. Configure your box for DNS provider like adguard which provides a pre-filtered DNS access.
  2. Buy a x86 based router with much memory & powerful CPU, like an APU2 with 4GB memory. DNSMASQ with ~ 100K blocked domains takes approx. 24 MB memory ... roughly estimated your dnsmasq instance will take > 250 MB memory.
  3. Try to use unbound as dns backend, it's also supported by adblock. Maybe it behaves better ... but no promises.
  4. To speed up the processing time you could install coreutils-sort, it's much more efficient than busybox sort.
1 Like

Is it possible to run external script after AdBlock fishes processing lists? Is there some kind of trigger? If no, maybe it would be possible to add option to run own script after Adblock finishes processing all lists.

Yes, of course. Adblock is using procd, the central process management daemon in LEDE. Here a small snippet to ask the status via ubus call:

#!/bin/sh

cnt=0
while true
do
    adb_running="$(ubus -S call service list "{\"name\":\"adblock\"}" | jsonfilter -l1 -e "@.adblock.instances.*.running")"
    if [ "${adb_running}" = "true" ]
    then
        echo "adblock is running"
        cnt=$((cnt+1))
        sleep 1
    else
        echo "adblock has been finished, after ${cnt} seconds"
        break
    fi
done

As usual you can also grep for the adblock process or similar things ...

But if script will run in endless loop it will constantly run my script if not break or script will end after first Adbloct run and should be again run by e.g cron.
Now I run my script using cronjob but looking for solution that trigger it always after Adblock processing without constantly polling procd or grepping processes.
Something opposite to run Adblock after interface trigger.

Edit: I could use interface triggering in Adblock and script in hotplug. Thinking hurts... :smile:

I will use debug and see how it goes it is not noticeable that much but I noticed it. I will also use sort and will report back

@dibdot, First of all a huge thank you for making this adblocker. It is the easiest implementation I can think off. I just upgraded to the 2.6.2 version, but the adblock process does not start at boot. I have to do a manual restart later on to get it started. Just like @brokenpipe I don't see any logfile entries or status reports. A manual restart fixes this. I tried already disable/enable, and the adblock "symlink" in /etc/rc.d directory is a S50adblock. Any hints, on why the process does not start on boot? I run on a TP-link WR1043ND v2 with LEDE Reboot 17.01.1.