2017-05-13 26 views
1

루프백 및 eth0 네트워크 인터페이스가있는 대상에서 Yocto 이미지를 만들었습니다.Yocto ifconfig가 ifdown 후에 정리되지 않음 -a

고정 IP로/etc/network/interface를 구성하면 network down 명령이 작동합니다. ifdown -a 명령 다음에 ifconfig는 아무것도 반환하지 않습니다.

정적 모드에서 내을/etc/네트워크/인터페이스하십시오 ifup을 -a 명령 후

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)   

# The loopback interface               
auto lo                   
iface lo inet loopback               

# Main wired interface 
auto eth0               
iface eth0 inet dhcp 

, ifconfig를 반환 :

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)   

# The loopback interface               
auto lo                   
iface lo inet loopback               

# Main wired interface  
auto eth0              
iface eth0 inet static               
    address 192.168.1.10              
    netmask 255.255.255.0              
    gateway 192.168.1.1               
    dns-nameservers 192.168.1.1 

내 문제는 내가 DHCP 모드에서 eth0를 구성 할 경우 온다 그 :

eth0  Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX       
      inet addr:192.168.1.133 Bcast:192.168.1.255 Mask:255.255.255.0  
      inet6 addr: <ipv6 address> Scope:Link     
      inet6 addr: <ipv6 address> Scope:Global 
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1      
      RX packets:553 errors:0 dropped:106 overruns:0 frame:0     
      TX packets:98 errors:0 dropped:0 overruns:0 carrier:0     
      collisions:0 txqueuelen:1000           
      RX bytes:70121 (68.4 KiB) TX bytes:11022 (10.7 KiB)     
      Interrupt:33               

lo  Link encap:Local Loopback            
      inet addr:127.0.0.1 Mask:255.0.0.0         
      inet6 addr: ::1/128 Scope:Host           
      UP LOOPBACK RUNNING MTU:65536 Metric:1        
      RX packets:2 errors:0 dropped:0 overruns:0 frame:0      
      TX packets:2 errors:0 dropped:0 overruns:0 carrier:0     
      collisions:0 txqueuelen:1            
      RX bytes:140 (140.0 B) TX bytes:140 (140.0 B) 

그러나, 후 ifdown을 -a -v

,
run-parts /etc/network/if-down.d             
ifconfig lo 127.0.0.1 down              
run-parts /etc/network/if-post-down.d           

run-parts /etc/network/if-down.d             
kill `cat /var/run/udhcpc.eth0.pid` 2>/dev/null         
ifconfig eth0 down                
run-parts /etc/network/if-post-down.d 

은 ifconfig는 다음을 반환

eth0  Link encap:Ethernet HWaddr fc:c2:3d:0d:bb:93       
      inet6 addr: fe80::fec2:3dff:fe0d:bb93/64 Scope:Link     
      inet6 addr: 2a02:1205:c69a:b970:fec2:3dff:fe0d:bb93/64 Scope:Global 
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1      
      RX packets:1304 errors:0 dropped:272 overruns:0 frame:0    
      TX packets:158 errors:0 dropped:0 overruns:0 carrier:0     
      collisions:0 txqueuelen:1000           
      RX bytes:148500 (145.0 KiB) TX bytes:16490 (16.1 KiB)     
      Interrupt:33 

eth0 인터페이스가 완전히 세척되지 않고 내 시스템에서 다른 사람의 일을 관리하기 위해 상태를 사용하기 때문에이 나를 ​​위해 문제입니다.

#!/bin/sh                  
#                    
# ifdown hook script for resolvconf            
#                    
# This file is part of the resolvconf package.         
#                    

[ -x /sbin/resolvconf ] || exit 0            

case "$ADDRFAM" in                
    inet|inet6) :  ;;               
    *)   exit 0 ;;               
esac                    

/sbin/resolvconf -d "${IFACE}.${ADDRFAM}" || : 

이 유무 :

나는 내가 (DHCP의 경우에 사용되지 않음)으로 ifdown 스크립트

고양이 /etc/network/if-down.d/resolvconf를 추가 패키지 resolvconf를 사용하여 정확한 뭐가 잘못 됐는지 생각해?

답변

-1

확인 마침내 제대로 만든 매개 변수를 청소하는 파일 /etc/network/if-down.d/resolvconf의 끝에 행

/sbin/resolvconf -d "${IFACE}.udhcpc" || : 

을 추가하여 해결 될 수있는 문제가 발견 udhcpc.