List Daniel F. Dickinson and Dharmik Parmar as watchcat maintainers.
This gives future package issues and reviews active contacts.
Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
Allow logical interface references in watchcat interface options.
Resolve those names to real netifd devices for ping -I.
Keep logical names for ifup and real-device find_config behavior.
Use separate helpers for ping and restart values to avoid eval.
Treat ModemManager mm_iface_name=null as empty, not a modem name.
Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
Keep the default restart timing based on the moment the recovery action
is triggered.
The optional reset_failure_timer path still starts a fresh failure window
after the recovery action finishes. This makes the two timing modes
explicit.
Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
Add an opt-in reset_failure_timer option for restart_iface and
run_script modes.
When enabled, watchcat starts a fresh failure window after the
recovery action finishes before allowing another recovery action.
The existing behavior remains the default.
Document the intended default and reset_failure_timer timing
behavior in TIMINGS.md and use a safer string comparison for the
reset_failure_timer check.
Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
Clarify the restart_iface logging so the message reflects that the
configured action happens only after the failure period is reached.
Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
Watchcat was failing to restart layer-3 interfaces when in mode
'restart_iface'. The previously attempted fix made the situation
worse in that it resulted in layer 2 interfaces also failing to
start.
This was because we are passed the interface name (e.g. eth0,
l2p0, or br-lan), but ifup needs the logical network (e.g. 'lan'
which corresponds to the network device).
Update to use find_config from /lib/network/config.sh to find the
logical network from the interface name, and use ifup on the
logical network to restart the underlying interface(s) associated
with the logical network.
Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
As reported in #23410 Network interface reset doesn't work as expected
on a Wireguard VPN interface and in #27927 lt2p interface won't reboot,
and mentioned in #27248, the current implementation of the option to
restart an interface when connectivity check fails for some period does
not result in an interface restart for all interface.
Notably 'virtual' interfaces such as Wireguard and L2TP do not restart.
The solution that works is to use `ifup <interface>` instead of only
changing the link status.
This commit is based on the one in #27248 by @rondoval, who unfortunately
has not updated the commit message as requested for half a year.
Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
The quoting added in r18 for pinghosts is not needed. Multi-host support
remains fully functional, but the extra quotes caused inconsistent argument
handling between /etc/init.d/watchcat and /usr/bin/watchcat.sh,
especially for single-IP configurations.
This revert removes the unnecessary quoting in the init script and LUCI,
restoring consistent behavior while keeping multiple ping hosts supported.
Fixes: #28100 (watchcat: error if only one address is specified in pinghosts)
Signed-off-by: Ivan Diaz <diaz.it@icloud.com>
Although the watchcat_ping function also checked the iface variable, that
variable was never populated. As a result we could not check if there was
connectivity via a specific interface.
Signed-off-by: Vasileios Anagnostopoulos <anagnwstopoulos@hotmail.com>
Set mmifacename default to "null" instead of an empty string to avoid
argument displacement when the value is not defined. Also remove leftover
debug comments from previous commit.
Signed-off-by: Ivan Diaz <diaz.it@icloud.com>
The backend now correctly supports multiple IP addresses and avoids
argument shifting when mmifacename is empty.
Signed-off-by: Ivan Diaz <diaz.it@icloud.com>
Without this change these settings:
Mode: Restart Interface
Period: 30s
Check Interval: 5s
will do ping every 30s, if all pings are fail then
it try to take action every 5 second.
After apply this patch watchcat will try to send
ping every 5 second in next 30 sec before take action if
all pings are fail.
This is important for wireless uplinks like 3G/4G that
need some time to establish connection.
Signed-off-by: Rozhuk Ivan <rozhuk.im@gmail.com>
nopingtime UCI option rationale:
I want relatively fast reaction(i.e. 1m or 2m) for 'no internet' condition,
but i don't want my router to reboot every 1 minute if there is still no
internet after reboot.
initd_watchcat:
* add: nopingtime uci option support
* add: defaults to all non-critical options
* add: log warnings for non-critical errors(when option is missed and
default is applyed)
* fix: error handling and config_get defaults are somtimes in conflict
because of config_get defaults. They are gone now, error handling improved.
* fix: calling watchcat.sh with 'period' mode instead of 'ping'. Typo?
* fix: pingperiod default changed from period/20 to more reasonable period/5
watchcat.sh:
* add: nopingtime uci option support( sleep if uptime < nopingtime )
* remove: [ "$mode" = "allways" ] && mode="always" - not needed, already
done by initd_watchcat in load_watchcat() func
* add: echo 1 > /proc/sys/kernel/sysrq before sysrq-trigger
* refactor: eliminated once used not needed variables, code size reduced.
* PKG_RELEASE bumped up
Signed-off-by: Vasily Trotzky <trotzky.vas@gmail.com>
Packages such as Perl, Lua, shell scripts don't generate binary files.
Add PKGARCH:=all to them.
Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
This patch fixes the watchcat init script in case of mode 'always'.
This mode just needs the config parameters: mode, period and forcedelay.
But a wrong check against the variable pingperiod, needed in the mode 'ping'
prevented mode 'always' to work properly.
Signed-off-by: Tobias Ilte <tobias.ilte@campus.tu-berlin.de>
Note that this implies an API change (allways -> always).
The wrong spelling "allways" is still accepted for backward compatibility.
Signed-off-by: Stefan Weil <sw@weilnetz.de>