2013-02-06 2 views
4

데비안 프로그램에서 dhclient를 호출하는 프로그램이 궁금합니다.어떤 프로그램이 debian squeeze에서 dhclient를 호출합니까?

네트워크 매니저라고 의심되지만 사실이 아닙니다. 제거 했으므로 (apt-get NetworkManager) 컴퓨터를 재부팅하십시오.

dhclient 프로그램은 평소대로 실행됩니다. 참조 :

~$ ps aux|grep dhclient 

root  2042 0.0 0.0 2332 532 ?  Ss 09:47 0:00 dhclient -v -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0 

을 나는 또한 /etc에서 dhclient에 대한 grep을하지만 충분한 힌트 (발신자를 찾을 수 없음)이 없습니다.

Debian Squeeze에서 dhclient 프로그램이 어떻게 호출됩니까?

# The primary network interface 
allow-hotplug eth0 
auto eth0 
iface eth0 inet dhcp 

사람 :

+0

내가 설치하는 방법 고정 IP를 알고

http://packages.debian.org/stable/ifupdown

체크 기능 dhcp_up()를 소스도 및

메이크업의 inet.c

를 다운로드합니다. 내 질문에 어떤 프로그램 dhclient 프로그램을 호출하는 것입니다? – robertchen

답변

8

ifupdown에 코드가 있습니다.

static int dhcp_up(interface_defn *ifd, execfn *exec) { 
{ 
    if (!execute("[[ifconfig %iface% hw %hwaddress%]]", ifd, exec)) return 0; 
} 
if (execable("/sbin/dhclient3")) { 
    if (!execute("dhclient3 -pf /var/run/dhclient.%iface%.pid -lf /var/lib/dhcp3/dhclient.%iface%.leases %iface%", ifd, exec)) return 0; 
} 
else if (execable("/sbin/dhclient")) { 
    if (!execute("dhclient -v -pf /var/run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases %iface%", ifd, exec)) return 0; 
} 
else if (execable("/sbin/pump") && mylinuxver() >= mylinux(2,1,100)) { 
    if (!execute("pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]]", ifd, exec)) return 0; 
} 
else if (execable("/sbin/udhcpc") && mylinuxver() >= mylinux(2,2,0)) { 
    if (!execute("udhcpc -n -p /var/run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]]   [[-c %client%]]", ifd, exec)) return 0; 
} 
else if (execable("/sbin/dhcpcd")) { 
    if (!execute("dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]]   [[-l %leasetime%]] %iface%", ifd, exec)) return 0; 
} 
return 1; 
} 
2

당신은 DHCP를 비활성화하고 인터페이스 대신

을/etc/네트워크/인터페이스에서 수행 할 수 있습니다

변경에 대한 고정 IP 주소를 설정해야 :

# The primary network interface 
allow-hotplug eth0 
auto eth0 
iface eth0 inet static 
    address 192.168.0.1 
    netmask 255.255.255.0 

재부팅 후 dhclient는 사라져야합니다.

+0

재미있게도 실제로는 dhclient를 죽이는 것처럼 보이지 않습니다 ... 서버를 재부팅하지 않으면됩니다. – DustWolf

3

ifupdown (구성 파일 : /etc/network/interfaces).

관련 문제