然后尝试开启 nginx 服务,执行命令 /etc/init.d/nginx start ,访问一下 qemu 环境的 IP ,看服务是否启动(如下)
没跑起来,然后看一下报错信息(如下)
/ # /etc/init.d/nginx start uci: Entry not found chown: /var/firmware: No such file or directory chown: /var/3g-4g-driver: No such file or directory chown: /var/in_certs: No such file or directory chown: /var/signature: No such file or directory chown: /var/language-pack: No such file or directory chown: /var/configuration: No such file or directory FAILED: confd_load_schemas(addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2413 uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found touch: /tmp/stats/certstats.tmp: No such file or directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory FAILED: confd_load_schemas(addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2413 uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found touch: /tmp/stats/certstats.tmp: No such file or directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory FAILED: confd_load_schemas(addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2413 uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found touch: /tmp/stats/certstats.tmp: No such file or directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory Collected errors: * opkg_conf_load: Could not create lock file /var/lock/opkg.lock: No such file or directory. nginx: [emerg] open() "/var/lock/nginx.lock.accept" failed (2: No such file or directory) uci: Entry not found / # [uWSGI] getting INI configuration from /etc/uwsgi/blockpage.ini [uWSGI] getting INI configuration from /etc/uwsgi/jsonrpc.ini [uWSGI] getting INI configuration from /etc/uwsgi/upload.ini *** Starting uWSGI 2.0.15 (32bit) on [Mon Jul 31 06:57:28 2023] *** compiled with version: 4.8.3 on 17 October 2022 13:32:49 os: Linux-3.2.0-4-vexpress #1 SMP Debian 3.2.51-1 nodename: debian-armhf machine: armv7l clock source: unix pcre jit disabled detected number of CPU cores: 4 current working directory: / detected binary path: /usr/sbin/uwsgi *** Starting uWSGI 2.0.15 (32bit) on [Mon Jul 31 06:57:28 2023] *** compiled with version: 4.8.3 on 17 October 2022 13:32:49 os: Linux-3.2.0-4-vexpress #1 SMP Debian 3.2.51-1 nodename: debian-armhf machine: armv7l clock source: unix pcre jit disabled detected number of CPU cores: 4 current working directory: / detected binary path: /usr/sbin/uwsgi *** Starting uWSGI 2.0.15 (32bit) on [Mon Jul 31 06:57:28 2023] *** setgid() to 33 compiled with version: 4.8.3 on 17 October 2022 13:32:49 os: Linux-3.2.0-4-vexpress #1 SMP Debian 3.2.51-1 nodename: debian-armhf machine: armv7l clock source: unix pcre jit disabled detected number of CPU cores: 4 current working directory: / detected binary path: /usr/sbin/uwsgi setgid() to 33 setgid() to 33 setuid() to 33 setuid() to 33 setuid() to 33 your processes number limit is 961 your memory page size is 4096 bytes detected max file descriptor number: 1024 your processes number limit is 961 your memory page size is 4096 bytes lock engine: pthread robust mutexes detected max file descriptor number: 1024 lock engine: pthread robust mutexes your processes number limit is 961 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:9001 fd 3 uwsgi socket 0 bound to TCP address 127.0.0.1:9000 fd 3 your server socket listen backlog is limited to 100 connections your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:9003 fd 3 your mercy for graceful operations on workers is 60 seconds your server socket listen backlog is limited to 100 connections mapped 128512 bytes (125 KB) for 1 cores mapped 321280 bytes (313 KB) for 4 cores *** Operational MODE: preforking *** initialized CGI mountpoint: /jsonrpc = /www/cgi-bin/jsonrpc.cgi *** Operational MODE: single process *** initialized CGI mountpoint: /blocked.php = /www/cgi-bin/blockpage.cgi *** no app loaded. going in full dynamic mode *** your mercy for graceful operations on workers is 60 seconds *** no app loaded. going in full dynamic mode *** mapped 128512 bytes (125 KB) for 1 cores *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 2903) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI worker 1 (pid: 2906, cores: 1) spawned uWSGI master process (pid: 2904) *** Operational MODE: single process *** initialized CGI path: /www/cgi-bin/upload.cgi *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 2905) spawned uWSGI worker 1 (pid: 2909, cores: 1) spawned uWSGI worker 2 (pid: 2908, cores: 1) spawned uWSGI worker 1 (pid: 2907, cores: 1) spawned uWSGI worker 3 (pid: 2910, cores: 1) spawned uWSGI worker 4 (pid: 2911, cores: 1)
就这里有一个报错 FAILED: confd_load_schemas(addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2413 也不太清楚这是什么,但是这里有一个 confd ,而在 /etc/init.d 目录下,有一个 confd 服务(查了一下资料,说是轻量级的配置管理工具),那就给它启起来,执行 /etc/init.d/confd start
报错信息如下
/ # /etc/init.d/confd start uci: Entry not found cp: can't stat '/etc/ssl/private/Default.pem': No such file or directory Failed reading '/tmp/dropbear_host_key' TRACE Connected (maapi) to ConfD attaching to init session... TRACE MAAPI_ATTACH --> CONFD_OK TRACE MAAPI_DELETE /avc-meta-data --> CONFD_OK TRACE MAAPI_LOAD_CONFIG_FILE --> CONFD_OK TRACE Connected (maapi) to ConfD attaching to init session... TRACE MAAPI_ATTACH --> CONFD_OK TRACE MAAPI_DELETE /device-os-types --> CONFD_OK TRACE MAAPI_LOAD_CONFIG_FILE --> CONFD_OK TRACE Connected (maapi) to ConfD attaching to init session... TRACE MAAPI_ATTACH --> CONFD_OK TRACE MAAPI_DELETE /webfilter-meta-data --> CONFD_OK TRACE MAAPI_LOAD_CONFIG_FILE --> CONFD_OK 0 uci: Entry not found uci: Entry not found CDB boot error: Init transaction failed to validate: /confd_dyncfg:confdConfig: Need read access to one of the files ./ssh/ssh_host_dsa_key and ./ssh/ssh_host_rsa_key defined for /confdConfig/aaa/sshServerKeyDir 0 connection refused (start_phase2) uci: Entry not found uci: Entry not found uci: Entry not found FAILED: confd_load_schemas(addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2413 FAILED: confd_load_schemas(addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2413 uci: Entry not found uci: Entry not found FAILED: maapi_connect(ms, addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2432 FAILED: maapi_connect(ms, addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2432 FAILED: maapi_connect(ms, addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2432 FAILED: maapi_connect(ms, addr, addrlen), Error: system call failed (24): Connection refused, in function run, line 2432
然后这里出现的报错是 cp: can't stat '/etc/ssl/private/Default.pem': No such file or directory 这意味着是缺少 ssl 证书,搜索一下字符串 /etc/ssl/private (我是放到 vscode 里搜的)发现大概有十几个文件吧,里面有一个文件叫做 generate_default_cert ,这名字一听就很正经,叫做生成默认证书😄
因此执行 generate_default_cert,发现还有报错,信息如下
/ # generate_default_cert uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found uci: Entry not found cp: can't stat '/tmp/etc/config/certificate': No such file or directory touch: /tmp/stats/certstats.tmp: No such file or directory /usr/bin/certscript: line 1: can't create /tmp/stats/certstats.tmp: nonexistent directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory Default
/ # /etc/init.d/boot boot mount: mounting debugfs on /sys/kernel/debug failed: No such file or directory Mounting mnt partitions..mount: mounting /dev/mtdblock9 on /mnt/configcert failed: No such device mount: mounting /dev/mtdblock10 on /mnt/avcsign failed: No such device mount: mounting /dev/mtdblock11 on /mnt/webrootdb failed: No such device mount: mounting /dev/mtdblock12 on /mnt/license failed: No such device done. create_meta_data_xml begin meta_data_gen_state: 0 meta_data_gen_state: 1 create_meta_data_xml end / # generate_default_cert touch: /tmp/stats/certstats.tmp: No such file or directory /usr/bin/certscript: line 1: can't create /tmp/stats/certstats.tmp: nonexistent directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory Default
/ # /etc/init.d/confd start TRACE Connected (maapi) to ConfD attaching to init session... TRACE MAAPI_ATTACH --> CONFD_OK TRACE MAAPI_DELETE /avc-meta-data --> CONFD_OK TRACE MAAPI_LOAD_CONFIG_FILE --> CONFD_OK TRACE Connected (maapi) to ConfD attaching to init session... TRACE MAAPI_ATTACH --> CONFD_OK TRACE MAAPI_DELETE /device-os-types --> CONFD_OK TRACE MAAPI_LOAD_CONFIG_FILE --> CONFD_OK TRACE Connected (maapi) to ConfD attaching to init session... TRACE MAAPI_ATTACH --> CONFD_OK TRACE MAAPI_DELETE /webfilter-meta-data --> CONFD_OK TRACE MAAPI_LOAD_CONFIG_FILE --> CONFD_OK 0 uci: Entry not found 0 uci: Entry not found uci: Entry not found uci: Entry not found
uci: Parse error (option/list command found before the first section) at line 2492, byte 1 cp: can't stat '/tmp/etc/syslog_config_template': No such file or directory sed: /tmp/syslog-ng.conf: No such file or directory Error opening configuration file; filename='/tmp/syslog-ng.conf', error='Success (0)' SIOCGMIIPHY: No such device Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus Failed to parse json data: unexpected end of data Failed to connect to ubus 0 PnP Agent is starting!
/ # /etc/init.d/nginx start chown: /var/firmware: No such file or directory chown: /var/3g-4g-driver: No such file or directory chown: /var/in_certs: No such file or directory chown: /var/signature: No such file or directory chown: /var/language-pack: No such file or directory chown: /var/configuration: No such file or directory FAILED: maapi_get_elem(ms, mtid, &val, argv[0]), Error: item does not exist (1): /firewall-basic-settings:firewall/remote-web-management/cert does not exist, in function do_maapi_get, line 1463 touch: /tmp/stats/certstats.tmp: No such file or directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory FAILED: maapi_get_elem(ms, mtid, &val, argv[0]), Error: item does not exist (1): /ciscosb-restconf:ciscosb-restconf/transport/https/cert does not exist, in function do_maapi_get, line 1463 touch: /tmp/stats/certstats.tmp: No such file or directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory FAILED: maapi_get_elem(ms, mtid, &val, argv[0]), Error: item does not exist (1): /ciscosb-netconf:ciscosb-netconf/transport/ssh/cert does not exist, in function do_maapi_get, line 1463 touch: /tmp/stats/certstats.tmp: No such file or directory perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). cp: can't stat '/tmp/stats/certstats.tmp': No such file or directory / # [uWSGI] getting INI configuration from /etc/uwsgi/upload.ini [uWSGI] getting INI configuration from /etc/uwsgi/blockpage.ini [uWSGI] getting INI configuration from /etc/uwsgi/jsonrpc.ini *** Starting uWSGI 2.0.15 (32bit) on [Mon Jul 31 11:52:02 2023] *** compiled with version: 4.8.3 on 17 October 2022 13:32:49 os: Linux-3.2.0-4-vexpress #1 SMP Debian 3.2.51-1 nodename: Router machine: armv7l clock source: unix pcre jit disabled detected number of CPU cores: 4 current working directory: / detected binary path: /usr/sbin/uwsgi setgid() to 33 *** Starting uWSGI 2.0.15 (32bit) on [Mon Jul 31 11:52:02 2023] *** compiled with version: 4.8.3 on 17 October 2022 13:32:49 os: Linux-3.2.0-4-vexpress #1 SMP Debian 3.2.51-1 nodename: Router machine: armv7l clock source: unix pcre jit disabled detected number of CPU cores: 4 current working directory: / detected binary path: /usr/sbin/uwsgi setgid() to 33 setuid() to 33 setuid() to 33 your processes number limit is 961 your processes number limit is 961 your memory page size is 4096 bytes your memory page size is 4096 bytes detected max file descriptor number: 1024 detected max file descriptor number: 1024 lock engine: pthread robust mutexes lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:9003 fd 3 *** Starting uWSGI 2.0.15 (32bit) on [Mon Jul 31 11:52:02 2023] *** compiled with version: 4.8.3 on 17 October 2022 13:32:49 os: Linux-3.2.0-4-vexpress #1 SMP Debian 3.2.51-1 nodename: Router machine: armv7l clock source: unix pcre jit disabled detected number of CPU cores: 4 current working directory: / detected binary path: /usr/sbin/uwsgi your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:9000 fd 3 your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 128512 bytes (125 KB) for 1 cores *** Operational MODE: single process *** initialized CGI path: /www/cgi-bin/upload.cgi *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 4377) spawned uWSGI worker 1 (pid: 4380, cores: 1) setgid() to 33 mapped 321280 bytes (313 KB) for 4 cores setuid() to 33 your processes number limit is 961 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) *** Operational MODE: preforking *** initialized CGI mountpoint: /jsonrpc = /www/cgi-bin/jsonrpc.cgi *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 4375) spawned uWSGI worker 1 (pid: 4385, cores: 1) uwsgi socket 0 bound to TCP address 127.0.0.1:9001 fd 3 your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds spawned uWSGI worker 2 (pid: 4386, cores: 1) mapped 128512 bytes (125 KB) for 1 cores *** Operational MODE: single process *** initialized CGI mountpoint: /blocked.php = /www/cgi-bin/blockpage.cgi *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 4376) spawned uWSGI worker 3 (pid: 4387, cores: 1) spawned uWSGI worker 4 (pid: 4389, cores: 1) spawned uWSGI worker 1 (pid: 4388, cores: 1)
while true; do PID=$(pidof upload.cgi) if [ -n "$PID" ]; then echo "upload.cgi process ID is:$PID" ./gdbserver 0.0.0.0:9999 --attach $PID else echo "No get upload.cgi process ID" fi done