Closed superzjg closed 8 months ago
[V2.0.3]配合arm64的speedtest-web,当从 luci界面关闭启用后,会自动重新拉起,再关闭再被拉起,重复5次。猜测是触发了procd的检测机制。init.d中start_service()脚本,注释speedtestweb_prepare一行即可解决,它的作用是kill进程(也可以保留speedtestweb_prepare,注释procd_set_param respawn,但这样貌似不太正规);另外stop_service中speedtestweb_prepare也是多余,导致当从命令行运行/etc/init.d/netspeedtest stop时,会被procd_set_param respawn自动拉起,procd会自己关闭运行的服务,无需设置额外的kill进程指令,反而会认为是意外终止而触发重启。
startservice() { speedtestweb_prepare_ config_load netspeedtest config_foreach get_config speedtestweb [ x$enabled == x1 ] || return 1 logger -t netspeedtest -p warn "Netspeedtest speedtest-web is start." echo "Netspeedtest speedtest-web is start." procd_open_instance procd_set_param command $PROG --listen_port "${port}" [ "x$logger" == x1 ] && procd_setparam stderr 1 procd_set_param respawn_ procd_close_instance } stop_service() { _speedtestwebprepare echo "Netspeedtest speedtest-web is stop." }
好,收到。
[V2.0.3]配合arm64的speedtest-web,当从 luci界面关闭启用后,会自动重新拉起,再关闭再被拉起,重复5次。猜测是触发了procd的检测机制。init.d中start_service()脚本,注释speedtestweb_prepare一行即可解决,它的作用是kill进程(也可以保留speedtestweb_prepare,注释procd_set_param respawn,但这样貌似不太正规);另外stop_service中speedtestweb_prepare也是多余,导致当从命令行运行/etc/init.d/netspeedtest stop时,会被procd_set_param respawn自动拉起,procd会自己关闭运行的服务,无需设置额外的kill进程指令,反而会认为是意外终止而触发重启。
startservice() { speedtestweb_prepare_ config_load netspeedtest config_foreach get_config speedtestweb [ x$enabled == x1 ] || return 1 logger -t netspeedtest -p warn "Netspeedtest speedtest-web is start." echo "Netspeedtest speedtest-web is start." procd_open_instance procd_set_param command $PROG --listen_port "${port}" [ "x$logger" == x1 ] && procd_setparam stderr 1 procd_set_param respawn_
procd_close_instance } stop_service() { _speedtestwebprepare echo "Netspeedtest speedtest-web is stop." }