20181207_jeffrey - silenceuncrio/diary GitHub Wiki
0910
reviewer, _get_user_level_by
今天第一試
Cisco 2951
interface tunnel 200
ip address 10.0.0.200 255.255.255.0
ip nhrp network-id 200
tunnel source GigabitEthernet 0/0
tunnel mode gre multipoint
no shutdown
先看一下 Cisco 2951 基本的狀態
Router#show interfaces tunnel 200
Tunnel200 is up, line protocol is up
Hardware is Tunnel
Internet address is 10.0.0.200/24
MTU 17916 bytes, BW 100 Kbit/sec, DLY 50000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation TUNNEL, loopback not set
Keepalive not set
Tunnel linestate evaluation up
Tunnel source 192.168.1.200 (GigabitEthernet0/0)
Tunnel Subblocks:
src-track:
Tunnel200 source tracking subblock associated with GigabitEthernet0/0
Set of tunnels with source GigabitEthernet0/0, 1 member (includes iterators), on interface <OK>
Tunnel protocol/transport multi-GRE/IP
Key disabled, sequencing disabled
Checksumming of packets disabled
Tunnel TTL 255, Fast tunneling enabled
Tunnel transport MTU 1476 bytes
Tunnel transmit bandwidth 8000 (kbps)
Tunnel receive bandwidth 8000 (kbps)
Last input never, output never, output hang never
Last clearing of "show interface" counters 00:01:06
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/0 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
Router#
Router#show ip nhrp
Router#
換 M300
今天來學一下 Dynamic Multipoint VPN (DMVPN) Phase 3 with Quagga NHRPd 把 gre 帶起來的方式
1000
M300 週會
1140
先幫忙看一下 M300 目前 develop branch web ui upgrade 的問題
發現 upgrade 到一半就停住了
利用 busybox top
Mem: 169228K used, 340260K free, 109760K shrd, 0K buff, 126020K cached
CPU: 23% usr 76% sys 0% nic 0% idle 0% io 0% irq 0% sirq
Load average: 3.63 3.14 3.12 2/99 24910
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
361 1 root R 10304 2% 41% /usr/sbin/icos_module_msg -i 44
368 1 root S 27476 5% 2% /usr/sbin/icos_module_msg -i 66
...
發現 /usr/sbin/icos_module_msg -i 44
特忙
這跟 aaron 提的 icos_module_msg 新架構有關
修改 proscend/prosrc/icos/promsg/icospromsg.c
@@ -538,6 +538,7 @@ int _init_registry(_module_event_registry *registry, int length)
case MODULE_SSH:
case MODULE_SNTP:
case MODULE_IPV6LAN:
+ case MODULE_WEB:
break;
default:
(END)
先讓 MODULE_WEB 不要使用自己獨立的 icos_module_msg 再試試
build image... ok
mfgtool 燒錄... ok
開機來試試 firmware upgrade
1300
firmware upgrade 成功了
不會被 /usr/sbin/icos_module_msg -i 44
卡住了
commit 9a5850e6ecbce594738fbcd725c568950fc8da12
Author: jeffrey <[email protected]>
Date: Fri Dec 7 13:03:29 2018 +0800
do not let the MODULE_WEB has it's own icospromsg:
or the firmware upgrade process will case `/usr/sbin/icos_module_msg -i 44` busy forever like the following:
Mem: 169228K used, 340260K free, 109760K shrd, 0K buff, 126020K cached
CPU: 23% usr 76% sys 0% nic 0% idle 0% io 0% irq 0% sirq
Load average: 3.63 3.14 3.12 2/99 24910
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
361 1 root R 10304 2% 41% /usr/sbin/icos_module_msg -i 44
368 1 root S 27476 5% 2% /usr/sbin/icos_module_msg -i 66
...
proscend/prosrc/icos/promsg/icospromsg.c | 1 +
1 file changed, 1 insertion(+)
1305
光做一個 firmware upgrade 的動作
來觀察一下 /home/log/web.log
root@Cellular Router:~# cat /home/log/web.log
[20181207 03:28:31] [_notify:827]Recv bcast evt 14 before module init done.Ignore it.
[20181207 03:28:33] [_notify:839]ICOS_UCAST_MODULE_APPLY
[20181207 03:28:50] [_notify:870]ICOS_BOOTINIT_DONE
[20181207 03:28:50] [web_dump:517]===init config===
[20181207 03:28:50] [web_dump:527][COM]conn_mgr=1,mod_init_done:1.
[20181207 03:28:50] [web_dump:555][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20181207 03:28:50] [web_dump:563][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20181207 03:28:50] [web_dump:563][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20181207 03:28:50] [web_dump:568][RTI]wan4_ifname=,wan6_ifname=.
[20181207 03:28:50] [reset_firewall:765]Allow all ips.
[20181207 03:28:50] [daemon_restart:633][DID0] remain IP server retry for 6 times.
[20181207 03:28:50] [daemon_restart:675][DMN]Lanch=>/usr/sbin/iweb -p 80 -d /www
[20181207 03:28:50] [daemon_restart:633][DID1] remain IP server retry for 6 times.
[20181207 03:28:50] [gen_key_files:579]IN
[20181207 03:28:50] [gen_key_files:591]iweb genkey pid = 2214
[20181207 03:28:50] [gen_key_files:594]OUT
[20181207 03:28:50] [is_request_start:622][DMN]disabled cause key not ready.
[20181207 03:28:50] [web_dump:563][DMN0]active=1,pid=2212,status=1,flag=0x0,DID0
[20181207 03:28:50] [web_dump:563][DMN1]active=1,pid=-1,status=0,flag=0x1,DID1
[20181207 03:28:50] [web_dump:517]===After daemon restart===
[20181207 03:28:50] [web_dump:527][COM]conn_mgr=1,mod_init_done:1.
[20181207 03:28:50] [web_dump:555][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20181207 03:28:50] [web_dump:563][DMN0]active=1,pid=2212,status=1,flag=0x0,DID0
[20181207 03:28:50] [web_dump:563][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20181207 03:28:50] [web_dump:568][RTI]wan4_ifname=,wan6_ifname=.
[20181207 03:28:53] [_msgcb:1177]IN(DID0,pid 2212)
<--
Starting HTTP on port 80, serving /www
-->
[20181207 03:28:53] [daemon_event:1152]Starting HTTP success
[20181207 03:29:27] [_termcb:1066]IN(2214)
[20181207 03:29:27] [_termcb:1117]HTTPS key and cert generated done.
[20181207 03:29:27] [web_dump:517]===Key file generated done, daemon restart===
[20181207 03:29:27] [web_dump:563][DMN0]active=1,pid=2212,status=1,flag=0x0,DID0
[20181207 03:29:27] [web_dump:563][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20181207 03:29:27] [daemon_restart:633][DID1] remain IP server retry for 6 times.
[20181207 03:29:27] [gen_key_files:579]IN
[20181207 03:29:27] [gen_key_files:594]OUT
[20181207 03:29:27] [daemon_restart:675][DMN]Lanch=>/usr/sbin/iweb -p 443 -d /www -s
[20181207 03:29:28] [_msgcb:1177]IN(DID1,pid 4692)
<--
Starting HTTPS on port 443, serving /www
-->
[20181207 03:29:28] [daemon_event:1159]Starting HTTPS success
[20181207 03:31:39] [_msgcb:1177]IN(DID0,pid 2212)
<--
cookie_header NULL
-->
[20181207 03:31:50] [_msgcb:1177]IN(DID0,pid 2212)
<--
cookie_header NULL
-->
[20181207 03:31:50] [_msgcb:1177]IN(DID0,pid 2212)
<--
_handler_level_normal: /cgi-bin/firmware.cgi
-->
[20181207 03:31:50] [_msgcb:1177]IN(DID0,pid 2212)
<--
cookie_header NULL
_handler_level_normal: send 401 error
-->
[20181207 03:31:57] [_msgcb:1177]IN(DID0,pid 2212)
<--
0x12dcfa0 conn from [::ffff:192.168.1.113]:40372
login: user: root; pass:2wsx#EDC
user with name root check pass ok
-->
[20181207 03:31:57] [_msgcb:1177]IN(DID0,pid 2212)
<--
user root logged in with level 3, sid 64dde3550c3a9e67
-->
[20181207 03:31:57] [_msgcb:1177]IN(DID0,pid 2212)
<--
_handler_level_normal: /cgi-bin/syslog.cgi
root logged in with level 3, sid 64dde3550c3a9e67
-->
[20181207 03:31:57] [_notify:973]ICOS_SYSTEM_UPDATE
[20181207 03:31:57] [_notify:975]ICOS_UCAST_DMN_RESTART
[20181207 03:31:57] [_notify:976]daemon restart
[20181207 03:31:57] [web_dump:517]===init config===
[20181207 03:31:57] [web_dump:527][COM]conn_mgr=1,mod_init_done:1.
[20181207 03:31:57] [web_dump:555][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20181207 03:31:57] [web_dump:563][DMN0]active=1,pid=2212,status=1,flag=0x0,DID0
[20181207 03:31:57] [web_dump:563][DMN1]active=1,pid=4692,status=1,flag=0x0,DID1
[20181207 03:31:57] [web_dump:568][RTI]wan4_ifname=,wan6_ifname=.
[20181207 03:31:57] [_notify:1044]Daemon is running,add one retry count...
[20181207 03:31:57] [daemon_restart:633][DID0] remain IP server retry for 7 times.
[20181207 03:31:57] [daemon_restart:640][DMN] killed (2212).
[20181207 03:31:57] [daemon_restart:644][DMN] Wait exit(2212).
[20181207 03:31:57] [_notify:1044]Daemon is running,add one retry count...
[20181207 03:31:57] [daemon_restart:633][DID1] remain IP server retry for 7 times.
[20181207 03:31:57] [daemon_restart:640][DMN] killed (4692).
[20181207 03:31:57] [daemon_restart:644][DMN] Wait exit(4692).
[20181207 03:31:57] [web_dump:517]===After daemon restart===
[20181207 03:31:57] [web_dump:527][COM]conn_mgr=1,mod_init_done:1.
[20181207 03:31:57] [web_dump:555][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20181207 03:31:57] [web_dump:563][DMN0]active=1,pid=2212,status=2,flag=0x0,DID0
[20181207 03:31:57] [web_dump:563][DMN1]active=1,pid=4692,status=2,flag=0x0,DID1
[20181207 03:31:57] [web_dump:568][RTI]wan4_ifname=,wan6_ifname=.
[20181207 03:31:57] [_termcb:1066]IN(4692)
[20181207 03:31:57] [daemon_restart:633][DID1] remain IP server retry for 7 times.
[20181207 03:31:57] [gen_key_files:579]IN
[20181207 03:31:57] [gen_key_files:594]OUT
[20181207 03:31:57] [daemon_restart:675][DMN]Lanch=>/usr/sbin/iweb -p 443 -d /www -s
[20181207 03:31:57] [web_dump:517]===Daemon killed restart===
[20181207 03:31:57] [web_dump:563][DMN0]active=1,pid=2212,status=2,flag=0x0,DID0
[20181207 03:31:57] [web_dump:563][DMN1]active=1,pid=14866,status=1,flag=0x0,DID1
[20181207 03:31:57] [_termcb:1066]IN(2212)
[20181207 03:31:57] [daemon_restart:633][DID0] remain IP server retry for 7 times.
[20181207 03:31:57] [daemon_restart:675][DMN]Lanch=>/usr/sbin/iweb -p 80 -d /www
[20181207 03:31:58] [web_dump:517]===Daemon killed restart===
[20181207 03:31:58] [web_dump:563][DMN0]active=1,pid=14870,status=1,flag=0x0,DID0
[20181207 03:31:58] [web_dump:563][DMN1]active=1,pid=14866,status=1,flag=0x0,DID1
[20181207 03:31:58] [_msgcb:1177]IN(DID0,pid 14870)
<--
Starting HTTP on port 80, serving /www
-->
[20181207 03:31:58] [daemon_event:1152]Starting HTTP success
[20181207 03:31:58] [_msgcb:1177]IN(DID0,pid 14870)
<--
_handler_level_normal: /cgi-bin/syslog.cgi
-->
[20181207 03:31:58] [_msgcb:1177]IN(DID0,pid 14870)
<--
root logged in with level 3, sid 64dde3550c3a9e67
-->
[20181207 03:31:59] [_msgcb:1177]IN(DID1,pid 14866)
<--
Starting HTTPS on port 443, serving /www
-->
[20181207 03:31:59] [daemon_event:1159]Starting HTTPS success
[20181207 03:32:00] [_msgcb:1177]IN(DID0,pid 14870)
<--
_handler_level_normal: /cgi-bin/firmware.cgi
-->
[20181207 03:32:00] [_msgcb:1177]IN(DID0,pid 14870)
<--
root logged in with level 3, sid 64dde3550c3a9e67
-->
[20181207 03:32:00] [_msgcb:1177]IN(DID0,pid 14870)
<--
json_object_from_file: error opening file /tmp/FirmwareUpgrade.progress.json: No such file or directory
-->
[20181207 03:32:56] [_msgcb:1177]IN(DID0,pid 14870)
<--
_handler_level_admin: /cgi-bin/firmware.cgi
root logged in with level 3, sid 64dde3550c3a9e67
-->
[20181207 03:32:58] [_msgcb:1177]IN(DID0,pid 14870)
<--
_handler_level_normal: /cgi-bin/firmware.cgi
root logged in with level 3, sid 64dde3550c3a9e67
-->
...
[20181207 03:42:37] [_msgcb:1177]IN(DID0,pid 14870)
<--
root logged in with level 3, sid 64dde3550c3a9e67
-->
[20181207 03:42:39] [_msgcb:1177]IN(DID0,pid 14870)
<--
_handler_level_normal: /cgi-bin/firmware.cgi
root logged in with level 3, sid 64dde3550c3a9e67
-->
root@Cellular Router:~#
從以下的 log 發現 web upgrade 至少做了 10 分鐘
[20181207 03:32:58] [_msgcb:1177]IN(DID0,pid 14870)
<--
_handler_level_normal: /cgi-bin/firmware.cgi
root logged in with level 3, sid 64dde3550c3a9e67
-->
...
[20181207 03:42:37] [_msgcb:1177]IN(DID0,pid 14870)
<--
root logged in with level 3, sid 64dde3550c3a9e67
-->
1350
改一下 iweb 把沒必要 printf 拿掉節省 _msgcb 的呼叫次數
diff --git a/proscend/prosrc/icos/iweb/iweb.c b/proscend/prosrc/icos/iweb/iweb.c
index 2cde0d4..9ee3359 100644
--- a/proscend/prosrc/icos/iweb/iweb.c
+++ b/proscend/prosrc/icos/iweb/iweb.c
@@ -153,12 +153,12 @@ static int check_pass(const char *name, const char *pass)
{
if (strcmp(crypt(pass,"$1$"), Icos_users.users[i].pass) == 0)
{
- printf("user with name %s check pass ok\n", name);
+ //printf("user with name %s check pass ok\n", name);
return 1;
}
else
{
- printf("user with name %s check pass fail\n", name);
+ //printf("user with name %s check pass fail\n", name);
return 0;
}
}
...
@@ -1627,10 +1627,12 @@ int main(int argc, char *argv[])
if (start_ssl)
{
+ // the printf here is necessary for proc_msg_cb of web icos module
printf("Starting HTTPS on port %s, serving %s\n", s_http_port, s_http_server_opts.document_root);
}
else
{
+ // the printf here is necessary for proc_msg_cb of web icos module
printf("Starting HTTP on port %s, serving %s\n", s_http_port, s_http_server_opts.document_root);
}
(END)
build 個 image 看看 firmware upgrade 速度有沒有改善
1515
誤刪了一些 /build_small/image
下的一些檔案
目前還在搶救當中
先寫週報吧
1530
不救了
刪掉 /build_small/tmp
user@be6d814a16da:~/build_small$ rm -rf tmp/
再重 build 吧 - time source bimage.hs
1550
竟然 build 好了...
...
Summary: There were 8 WARNING messages shown.
real 14m40.445s
user 12m7.363s
sys 9m19.242s
user@be6d814a16da:~/build_small$
透過 web ui 做 firmware upgrade 非 ubi 的 image 並計時
該 M300 只接 lan port 而且沒有插 SIM 卡
07:20.8
改用 ubi image 看看有多快
01:57.9
真快
我還是先把我對 iweb 的修改 commit 上去吧
commit 67b90649430d6efdc582760392808d9ddb139151
Author: jeffrey <[email protected]>
Date: Fri Dec 7 16:33:22 2018 +0800
remove some unnecessary printf to save proc_msg_cb() invoking times in web icos mudule
proscend/prosrc/icos/iweb/iweb.c | 63 ++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 31 deletions(-)
1650
jessy 表示 M300 wifi 的版本 load factory 功能沒有動作
load factory 的作動源自於下述數的 CGI
http://192.168.1.1/cgi-bin/icos_config.cgi?act=load_factory_and_reboot
不過透過瀏覽器發現呼叫該 CGI 的回應卻是
500 Server Error: icos_config.cgi: Permission denied
許久不見的檔案執行權限跑掉的現象又出現了
找 aaron 一起幫 jessy 看
目前的建議是讓 jessy 把工作的虛擬機關掉重開再試試