Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Ticket" doesn't work on NETGERA 7800 + OpenWrt 19.07 #29

Open
AlicjaWC opened this issue Jun 9, 2020 · 4 comments
Open

"Ticket" doesn't work on NETGERA 7800 + OpenWrt 19.07 #29

AlicjaWC opened this issue Jun 9, 2020 · 4 comments

Comments

@AlicjaWC
Copy link

AlicjaWC commented Jun 9, 2020

installed version: luci-app-access-control_0.4.3_all
problem:
After the allotted time is over, the client is not blocked.
reason:
I found somewhere (but I don't remember where it was), the reason for this was that because it is a router with a multi-core processor, the call in the file /usr/lib/lua/luci/model/cbi/access_control.lua
os.execute ("/etc/init.d/inetac restart> / dev / null 2> / dev / null") caused the inetac script to terminate before the contents of /etc/config/firewall were modified.

I have applied the following changes:
In file: /usr/sbin/inetacd.lua
repleace the line
require "uci"
by the line
uci = require "luci.model.uci"
because line require "uci" generates a similar error to the one described #28
replace the /etc/init.d/inetac file with the one shown below in PROCD style
#!/bin/sh /etc/rc.common
START=70
STOP=15
PROG=/usr/sbin/inetacd.lua
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command /usr/bin/lua "$PROG"
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger "firewall"
}

Now we can remove line os.execute ("/etc/init.d/inetac restart> / dev / null 2> / dev / null") from /usr/lib/lua/luci/model/cbi/access_control.lua file (I don't remove it and it working for me too).

After making the above changes, "Tikets" works correctly.

@k-szuster
Copy link
Owner

Thank you, Alicja. I cannot verify your solution, but as it works, feel free to submit a patch and a pull request. I'll be happy to accept, since many users encountered the problem.

@hiuman1
Copy link

hiuman1 commented Jan 20, 2023

Jak dokładnie ma wyglądać zawartość pliku /usr/sbin/inetacd.lua . U mnie po upływie czasu klient nie jest ponownie blokowany.

What exactly should the contents of the /usr/sbin/inetacd.lua file look like? For me, after the time expires, the client is not blocked again.

@AlicjaWC
Copy link
Author

AlicjaWC commented Feb 1, 2023

Below are the contents of my /usr/sbin/inetacd.lua router file. As I wrote, the only change from the original is the replacement of the require "uci" entry with uci = require "luci.model.uci".

inetacd.lua.txt

If something does not work, I suggest you first check whether the added blocking rules appear at the end of the tab "Network > Firewall > TrafficRules" and then whether after issuing the ticket there is an active precess...

ps
13313 root 1852 S /usr/bin/lua /usr/sbin/inetacd.lua
13319 root 1080 S sleep 5435

Where "sleep time" should be equal to the given value "ticket validity" in seconds.

@hiuman1
Copy link

hiuman1 commented Feb 3, 2023

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants