Not able to start Adblock

Hi,

I’ve installed Adblock after migrating to TOS 5, but I am not able to get it work.
Any hints how to solve? More info below.

opkg --force-maintainer --force-reinstal --force-overwrite install adblock luci-app-adblock
opkg list-installed "*adblock"
adblock - 4.0.7-9
luci-app-adblock - git-21.314.39495-8bd4e78-1
/etc/init.d/adblock status
::: adblock runtime information
  + adblock_status  : error
  + adblock_version : 4.0.7
  + blocked_domains : 0
  + active_sources  : adaway adguard disconnect yoyo 
  + dns_backend     : -, -
  + run_utils       : -
  + run_ifaces      : trigger: lan, report: -
  + run_directories : base: /tmp, backup: /tmp, report: /tmp, jail: /tmp
  + run_flags       : backup: 1, reset: 0, flush: 1, force: 0, search: 0, report: 0, mail: 0, jail: 0
  + last_run        : stop, n/a, 2067/1616/1694, 04.12.2021 13:35:55
  + system          : Turris Omnia, TurrisOS 5.3.1 8fb714edd6e4340729e271139164a0163b027d68
cat /etc/config/adblock

config adblock 'global'
	option adb_enabled '1'
	option adb_safesearch '0'
	option adb_dnsfilereset '0'
	option adb_mail '0'
	option adb_report '0'
	option adb_backup '1'
	option adb_maxqueue '4'
	list adb_sources 'adaway'
	list adb_sources 'adguard'
	list adb_sources 'disconnect'
	list adb_sources 'yoyo'
	option adb_forcedns '1'
	option adb_dnsflush '1'
	option adb_dns 'kresd'
	option adb_debug '1'
	option adb_repiface 'br-lan'
	option adb_fetchutil 'curl'
grep adblock /var/log/messages 
Dec  4 12:30:59 turris adblock-4.0.7[19320]: Please enable the 'DNS Report' option to use the reporting feature
Dec  4 12:30:59 turris adblock-4.0.7[19320]: f_report ::: action: report, report: 0, search: +, count: 50, process: false, print: json, dump_util: /usr/sbin/tcpdump, repdir: /tmp, repiface: -, replisten: 53, repchunksize: 1, repchunkcnt: 5, bg_pid: 
Dec  4 12:31:29 turris adblock-4.0.7[19460]: Please enable the 'DNS Report' option to use the reporting feature
Dec  4 12:31:29 turris adblock-4.0.7[19460]: f_report ::: action: report, report: 0, search: +, count: 50, process: false, print: json, dump_util: /usr/sbin/tcpdump, repdir: /tmp, repiface: -, replisten: 53, repchunksize: 1, repchunkcnt: 5, bg_pid: 
Dec  4 12:35:55 turris adblock-4.0.7[20785]: local opkg package repository is not available, please set 'adb_fetchutil' and 'adb_dns' manually
Dec  4 12:35:55 turris adblock-4.0.7[20785]: f_rmtemp ::: tmp_dir: -, src_file: /tmp/adb_sources.json, pid_file: /var/run/adblock.pid
Dec  4 12:35:55 turris adblock-4.0.7[20785]: f_rmdns  ::: dns: , status: -, dns_dir: , dns_file: adb_list.overall, rt_file: /tmp/adb_runtime.json, backup_dir: /tmp
Dec  4 12:35:55 turris adblock-4.0.7[20785]: f_bgserv ::: status: stop, bg_pid: -, dns_filereset: 0, ubus_service: /etc/adblock/adblock.monitor
Dec  4 12:35:55 turris adblock-4.0.7[20785]: f_jsnup  ::: status: error, cnt: 0, mail: 0, mail_service: /etc/adblock/adblock.mail, mail_cnt: 0, mail_pid: -

likely start here… ( add curl?, statically define your dns backend? or switch to a supported one… )

the log is trying to help you out…


command -v curl; command -v kresd

Thank you, both adb_dns and adb_fetchutil are set as you can see in the config.
Not sure why it’s not reflected in the status.
Adblock should work “out of the box” without setting these options anyway.
Neither reload or restart of the service change anything.

After rebooting the router no status is shown at all. It’s still not possible to start the service and the log is empty too.

etc/init.d/adblock status
::: no adblock runtime information available

Seems to me there’s an issue with the init script.
Launching /usr/bin/adblock.sh directly works. :thinking:

/etc/init.d/adblock status
::: adblock runtime information
  + adblock_status  : enabled
  + adblock_version : 4.0.7
  + blocked_domains : 46384
  + active_sources  : adaway adguard disconnect yoyo 
  + dns_backend     : kresd, /etc/kresd
  + run_utils       : /usr/bin/curl, /bin/awk
  + run_ifaces      : trigger: -, report: br-lan
  + run_directories : base: /tmp, backup: /tmp, report: /tmp, jail: /tmp
  + run_flags       : backup: 1, reset: 0, flush: 0, force: 0, search: 0, report: 0, mail: 0, jail: 0
  + last_run        : start, 0m 6s, 2067/1631/1695, 04.12.2021 17:24:39
  + system          : Turris Omnia, TurrisOS 5.3.1 8fb714edd6e4340729e271139164a0163b027d68
1 Like

Perhaps @dibdot could help?

Most probably the service is disabled (on Turris devices all non-core packages will be disabled by default for unknown reason). An /etc/init.d/adblock enable will fix this.

No it has not fixed the issue :frowning:

Post the output of /etc/init.d/adblock enabled; echo $?
and please provide your current adblock config (/etc/config/adblock)

/etc/init.d/adblock enabled; echo $?
0
cat /etc/config/adblock

config adblock 'global'
	option adb_enabled '1'
	option adb_safesearch '0'
	option adb_dnsfilereset '0'
	option adb_mail '0'
	option adb_report '0'
	option adb_backup '1'
	option adb_maxqueue '4'
	list adb_sources 'adaway'
	list adb_sources 'adguard'
	list adb_sources 'disconnect'
	list adb_sources 'yoyo'
	option adb_debug '1'
	option adb_repiface 'br-lan'
	option adb_dns 'kresd'
	option adb_fetchutil 'curl'
	option adb_forcedns '0'
	option adb_triggerdelay '30'

/etc/init.d/adblock start; echo $?
0
/etc/init.d/adblock status
::: no adblock runtime information available

OK, thanks. Please post the output of cat /var/run/adblock.pid
BTW, you haven’t configured a trigger interface (usually ‘wan’).

The output is empty.

Then start adblock via /etc/init.d/adblock restart and check the logs afterwards. Wait at least more than 30 seconds, cause you set a startup grace time of 30 seconds in your config.

Thanks, but it’s still the same.

root@turris:~# /etc/init.d/adblock restart && sleep 35 && cat /var/run/adblock.p
id
root@turris:~# /etc/init.d/adblock status
::: adblock runtime information
  + adblock_status  : enabled
  + adblock_version : 4.0.7
  + blocked_domains : 47272
  + active_sources  : adaway adguard disconnect reg_cz yoyo 
  + dns_backend     : kresd, /etc/kresd
  + run_utils       : /usr/bin/curl, /bin/awk
  + run_ifaces      : trigger: wan, report: br-lan
  + run_directories : base: /tmp, backup: /tmp, report: /tmp, jail: /tmp
  + run_flags       : backup: 1, reset: 0, flush: 0, force: 0, search: 0, report: 0, mail: 0, jail: 0
  + last_run        : restart, 0m 11s, 2067/162/1574, 06.12.2021 13:12:53
  + system          : Turris Omnia, TurrisOS 5.3.1 8fb714edd6e4340729e271139164a0163b027d68
root@turris:~# cat /var/run/adblock.pid
root@turris:~#

What do you mean by that? The status looks perfectly OK. Logs will be checked by logread. BTW, it’s OK that the pid file is empty after adblock run (adblock is not a daemon which runs permantly in the background).

1 Like

Oh, OK, I am fine then. Stopping and restarting work as supposed and log shows standard activity.
Thank you for your support, @dibdot !

2 Likes

Thank you @dibdot, thank you @milos for this ideal issue resolving; although your root cause probably was a different one the proper documentation helped me a lot to see what files and status to look at. Eventually I was able to successfully start Adblock for the first time since years. Thanks!

1 Like