我正在尝试通过串行线(RS-422)在iMX6和桌面之间建立PPP连接。但是在嵌入式系统的一侧,连接由于错误而失败:
警告:无法打开ppp数据库/var/run/pppd2.tdb
或
ioctl(SIOCGIFFLAGS):错误的文件描述符(第2389行)
我检查了几件事:
启用所有内核模块:
已安装的pppd包
带命令的完整输出如下:
root@imx6:~# pppd -d /dev/ttymxc0 38400 -detach lock nocrtscts nocdtrcts 192.168.0.2: netmask 255.255.255.0 &
[1] 355
root@imx6:~# Warning: couldn't open ppp database /var/run/pppd2.tdb
using channel 8
Using interface ppp0
Connect: ppp0 <--> /dev/ttymxc0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x9194c525> <pcomp> <accomp>]
rcvd [LCP ConfRej id=0x1 <pcomp> <accomp>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0> <magic 0x9194c525>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <magic 0x9194c525>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xcee8fa7d>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xcee8fa7d>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 192.168.0.2>]
rcvd [LCP EchoReq id=0x0 magic=0xcee8fa7d]
sent [LCP EchoRep id=0x0 magic=0x9194c525]
rcvd [IPCP ConfReq id=0x1 <addr 192.168.0.1>]
sent [IPCP ConfAck id=0x1 <addr 192.168.0.1>]
rcvd [CCP ConfReq id=0x1]
sent [CCP ConfAck id=0x1]
rcvd [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [CCP ConfReq id=0x2]
rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x2 <addr 192.168.0.2>]
rcvd [CCP ConfAck id=0x2]
rcvd [IPCP ConfAck id=0x2 <addr 192.168.0.2>]
sock_fd - number:4 (line 2386)
local IP address 192.168.0.2
remote IP address 192.168.0.1
Fatal signal 11
sock_fd - number:4 (line 2386)
ioctl (SIOCGIFFLAGS): Bad file descriptor (line 2389)
Script /etc/ppp/ip-up started (pid 358)
Modem hangup
Connect time 0.1 minutes.
Sent 0 bytes, received 0 bytes.
sock_fd - number:4 (line 2386)
Connection terminated.
Script /etc/ppp/ip-up finished (pid 358), status = 0x7f
Fatal signal 11
Script /etc/ppp/ip-down started (pid 359)
Script /etc/ppp/ip-down finished (pid 359), status = 0x7f
^C
[1]+ Done(16) pppd -d /dev/ttymxc0 38400 -detach lock nocrtscts nocdtrcts 192.168.0.2: netmask 255.255.255.0
以下行添加到pppd源以调试此问题:
sock_fd - number:4(第2386行)
有人知道我能做错什么或我错过了什么?
答案 0 :(得分:0)
我不知道前两个命令的意思,但我认为它们并不相关。
./ ltib -c
目标图像生成
最后一个
tmpfs size
我检查了文件系统,我有足够的空间。我看到的唯一奇怪的事情是,tmps并未安装到/var
,而是/var/volatile
。
root@device:~# df -h
Filesystem Size Used Available Use% Mounted on
ubi0:root 90.6M 58.5M 32.1M 65% /
devtmpfs 344.2M 0 344.2M 0% /dev
tmpfs 504.3M 44.0K 504.3M 0% /run
tmpfs 504.3M 24.0K 504.3M 0% /var/volatile
root@device:~# ls -l /var/run/
drwxr-xr-x 2 messageb messageb 60 Jan 5 15:33 dbus
-rw-r--r-- 1 root root 16 Jan 5 15:33 ifstate
lrwxrwxrwx 1 root root 16 Jan 1 1970 ld.so.cache -> /etc/ld.so.cache
drwxrwxrwt 3 root root 80 Jan 5 15:51 lock
-rw-r--r-- 1 root root 4 Jan 5 15:33 messagebus.pid
-rw-r--r-- 1 root root 4 Jan 5 15:51 ppp0.pid
-rw-r--r-- 1 root root 0 Jan 5 15:51 pppd2.tdb
-rw-r--r-- 1 root root 84 Jan 5 15:33 resolv.conf
drwxr-xr-x 2 root root 40 Jan 1 1970 sshd
-rw-r--r-- 1 root root 4 Jan 5 15:34 sshd.pid
drwxr-xr-x 5 root root 120 Jan 5 15:51 udev
-rw-r--r-- 1 root root 4 Jan 5 15:33 udhcpc.eth0.pid
-rw-rw-r-- 1 root root 0 Jan 1 1970 utmp
我还检查过写入/var/run
文件夹,这只是工作。
答案 1 :(得分:0)
通过在内核配置中启用CONFIG_FILE_LOCKING可以解决此问题。