What program calls dhclient on debian squeeze?

I am wondering which program calls dhclient when compressing Debian?

I suspect this is NetworkManager, but it is not. Since I deleted it (apt-get remove NetworkManager) and rebooted the computer.

The dhclient program works as usual. Cm:

~$ 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 

I also grep for dhclient in /etc , but there are not enough hints (no caller found).

How does the dhclient program start when Debian is compressed?

+4
source share
3 answers

It is encoded in ifupdown.

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

Download souce and

make inet.c

Check out the dhcp_up () function:

 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; } 
+8
source

ifupdown (configuration file: /etc/network/interfaces ).

+3
source

You need to disable dhcp and set a static IP address for your interface.

This can be done in / etc / network / interfaces

Edit:

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

To:

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

After rebooting, dhclient should be gone.

+2
source

All Articles