Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

AB-Solution - The Ad Blocking Solution (v3.9.1)

Discussion in 'Asuswrt-Merlin' started by thelonelycoder, Feb 15, 2017.

  1. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    The DESC variable in the S80... file.

    And it starts from . Which is /opt/bin/, the 'root' for Entware binaries.
     
  2. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    To elaborate, I was on my mobile earlier and I hate to use the phone to type...
    That line is sent to logfile from /opt/etc/init.d/rc.func, line 42:
    Code:
    logger "Started $DESC from $CALLER."
    The /opt/etc/init.d/rc.unslung iterates through S.. files, in order of the number that follows (s means it's a start file, k would be a kill file).
    S10.. would run before S20..
    The $DESC variable is from the /opt/etc/init.d/S80pixelserv-tls, which is itself built from two variables:
    Code:
    PROCS=pixelserv-tls
    DESC="$PROCS (AB-Solution)"
    The $CALLER is the S80pixelserv-tls in the current working directory CWD (/opt/etc/init.d/), hence the . (dot) short form.
    As in ./ab-solution.sh this translates to: run this file from the current working directory. In this case it is /home/root/, the admin/root $HOME directory on Asuswrt.


    Edit: I am wrong with the $CALLER. This variable is undefined and it simply prints the dot in the logger line $CALLER. It omits the variable.
     
    Last edited: Jun 4, 2017
  3. jack901

    jack901 Regular Contributor

    Joined:
    Feb 17, 2013
    Messages:
    128
    any particular reason when I update ab-solution it always delete a cronjob
    I have set up ya-malwareblock?.
    otherwise great solution.
    thanks
     
  4. Xentrk

    Xentrk Very Senior Member

    Joined:
    Jul 21, 2016
    Messages:
    872
    Location:
    Chiang Mai, Thailand
    Thank you. I have been seeing this in the system log for sometime now and never followed up on it. I wanted to make sure it was working correctly and that there were no more conflicts with any of the blocker scripts I run.
     
  5. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    How about that. To put yours and maybe other minds at rest, I looked into that gaping hole of potential useful information.

    To test it, I added some positional parameters to the relevant files and now get the following:
    At boot, when the /jffs/scripts/services-start kicks in:
    Code:
    Started pixelserv-tls (AB-Solution) from /jffs/scripts/services-start.
    And if you turn ad-blocking off and back on in the AB UI using the a option or off/on pixelserv in the ps menu you'll see:
    Code:
    Started pixelserv-tls (AB-Solution) from /tmp/mnt/primary/adblocking/addon/pixelserv-tls.add.
    Would that be worth adding?
    Edit: Posted updates to files in a post below.
     
    Last edited: Jun 5, 2017
    Xentrk likes this.
  6. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    AB-Solution does not delete cron jobs created by other scripts. That I can guarantee.
    UNLESS the cron job has the same name as one of AB's cron jobs.
    Use the cj function in AB to display the currently running cron jobs. Post this here, I'd be surprised if yours has the same name as the ones created by AB-Solution:
    Code:
     UpdateHosts: [a] is on, updates blocking file, weekly
     RotateLogs:  [l] is on, rotates log files, daily
     WeeklyStats: [rs] is on, sends stats, weekly
    How do you add the cron job in the first place? What script do you use and what does the line look like to add the cron job for your script?
     
    Last edited: Jun 5, 2017
  7. elorimer

    elorimer Senior Member

    Joined:
    Dec 16, 2013
    Messages:
    287
    Yes, I think so. It's consistent with the completeness of ab-solution.
     
    thelonelycoder likes this.
  8. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    As posted above, I have made some minor changes to the main script and the pixelserv-tls addon file.
    There is no version change, use 1233 in the AB UI to update to these latest versions.

    Changelog:
    ab-solution.sh: Added $0 positional parameter for ps start script verbose output in services-start *)
    pixelserv-tls.add: Added path and filename as positional parameter for ps start script verbose output
    pixelserv-tls.add: When updating or upgrading Entware packages, a new pixelserv-tls start file is written and pixelserv-tls is restarted.
    This is to prevent future problems should Entware overwrite the AB-generated start script.

    *) This change comes only in effect when a new /jffs/scripts/services-start file is written. This is almost never the case in AB.
    To take advantage of the added verbose output to syslog, you may do one of the following:
    - If you only have standard AB entries in the services-start file, just delete the file and then start the AB UI, the file will be recreated with the added parameter.
    (only do this if you know what you do)

    - You can add the parameter by hand to the services-start file:
    Change the line
    Code:
    $RC start
    to:
    Code:
    $RC start $0
    That's the number zero after the dollar character.
     
    Last edited: Jun 5, 2017
    Makaveli and Xentrk like this.
  9. Xentrk

    Xentrk Very Senior Member

    Joined:
    Jul 21, 2016
    Messages:
    872
    Location:
    Chiang Mai, Thailand
    Thanks @thelonelycoder, updates made and the message is now showing the from location.
    Code:
    Jun  5 19:34:08 admin: Started pixelserv-tls (AB-Solution) from /tmp/mnt/absolution/adblocking/addon/pixelserv-tls.add.
     
    thelonelycoder likes this.
  10. jack901

    jack901 Regular Contributor

    Joined:
    Feb 17, 2013
    Messages:
    128
    this is all standard taken from their install and I used this to add it.
    cru a UpdateYAMalwareBlock "0 */6 * * * /jffs/scripts/ya-malware-block.sh"
    and when I did a cru l it showed the ab stuff but ya-malware was gone .so just added it.
    I am going to update ab-solution later and see if changes or what might be changing as only run those 2 scripts.
    thanks


     
  11. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    But where is this cru line added to?
    You have to have it in one of the custom scripts.
     
  12. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    I just reread the instructions. You surely missed the part below your posted cru line.
    Read that again. Adding a cron job with your line in the terminal is not persistent, you need to add it every time you boot the router.
     
  13. jack901

    jack901 Regular Contributor

    Joined:
    Feb 17, 2013
    Messages:
    128
    oops ,sorry bout that! I only reboot the router with merlins firmware updates. guess that explains it as it was updated recently.
    thanks for figuring my mistake.
    thanks

     
  14. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    You're welcome, these are common mistakes. Paging @redhat27 to make that more clear and add the line explaining it above the cru code.
     
  15. redhat27

    redhat27 Senior Member

    Joined:
    Jul 29, 2016
    Messages:
    478
    Maybe I should make the "The schedule will only remain in effect till the next router boot unless also put in init-start" in bold? ;)
     
    thelonelycoder likes this.
  16. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    Why not add an append line of code for the lazy?
     
  17. unknownz

    unknownz Occasional Visitor

    Joined:
    Apr 10, 2016
    Messages:
    13
    With the new pixelserv-tls update, I was planning to use AB-solution to manage the installation and tried to use the [ps] option. However, I get the following error message
    Code:
    Error:  Your router's firmware (374.43) is too
    old and not capable to run pixelserv-tls.
    Upgrade your routers firmware first.
    I am currently running @john9627's LTS fork on a RT-N66U router, any thoughts?
     
  18. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    How old is this version, surely it's not the latest release.
    Copy and paste the following into the terminal and post output:
    Code:
    netstat -tuln | grep ":80 "
    It should return about two lines.

    Then enter the this, which should return nothing:
    Code:
    netstat -tuln | grep ":80 " | grep '0\.0\.0\.0:80 '
    If it does, your firmware is indeed too old to run pixelserv-tls.
     
    Last edited: Jun 6, 2017
  19. Bamsefar

    Bamsefar Regular Contributor

    Joined:
    Oct 11, 2014
    Messages:
    180
    I did a search on what I am about to ask, however I either can not search correct, or I don't know why or what I am looking for... I am trying to learn from time to time, even though I just upgraded to "version 5.0" (that is I just turned 50 years old, or young).

    I get this status email, and a few lines get me wondering what I am looking at, and particular this:
    The top 10 noisiest name clients:
    --------------------------------------------------
    46507 xxx.xxx.xxx.xx1 - 12097 99.1.xxx.xxx.in-addr.arpa - 26.0111%
    12214 xxx.xxx.xxx.xx2 - 12099 99.1.xxx.xxx.in-addr.arpa - 99.0585%

    Any idea what this is? 99.1.xxx.xxx seems to be AT&T internet in US - however I happen to be in Europe so I can not see any use for this. xx1 is a win10 machine, and xx2 is a Ubuntu server with only Squeeze Server software running. And what is this ".in-addr.arpa" kind of thing?
     
    Last edited: Jun 6, 2017
  20. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    2,911
    Location:
    In the heart of Switzerland
    Thats a reverse intenral query, you can hide it as follows:
    Use the es option in the sub menu.
    Select Dnsmasq settings, select default (d) for the first two and set domain-needed to on.
     

Share This Page