improve startup and runtime performance by 1) moving common startup procedures out of hotplug script when called from mwan3 start 2) reducing calls to iptables to check status of rules 3) consolidating iptables updates and updating with iptables-restore 4) do not wait for kill if nothing was killed 5) running interface hotplug scripts in parallel 6) eliminate operations in hotplug script that check status on every single interface unnecessarily 7) consolidate how mwan3track makes hotplug calls 8) do not restart mwan3track on connected events This is a significant refactor, but should not result in any breaking changes or require users to update their configurations. version bump to 2.9.0 Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
33 lines
665 B
Bash
Executable file
33 lines
665 B
Bash
Executable file
#!/bin/sh /etc/rc.common
|
|
|
|
START=19
|
|
USE_PROCD=1
|
|
|
|
boot() {
|
|
. /lib/config/uci.sh
|
|
# disabled until mwan3 start runs so hotplug scripts
|
|
# do not start prematurely
|
|
uci_toggle_state mwan3 globals enabled "0"
|
|
rc_procd start_service
|
|
}
|
|
|
|
# FIXME
|
|
# fd 1000 is an inherited lock file descriptor for preventing concurrent
|
|
# init script executions. Close it here to prevent the mwan3 daemon from
|
|
# inheriting it further to avoid holding the lock indefinitely.
|
|
|
|
reload_service() {
|
|
/usr/sbin/mwan3 restart 1000>&-
|
|
}
|
|
|
|
start_service() {
|
|
/usr/sbin/mwan3 start 1000>&-
|
|
}
|
|
|
|
stop_service() {
|
|
/usr/sbin/mwan3 stop 1000>&-
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger 'mwan3'
|
|
}
|