Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
哪个程序在debian挤压上调用dhclient?_Debian_Dhcp - Fatal编程技术网

哪个程序在debian挤压上调用dhclient?

哪个程序在debian挤压上调用dhclient?,debian,dhcp,Debian,Dhcp,我很好奇哪个程序在Debian上调用dhclient 我怀疑是NetworkManager,但不是真的。 因为我已经删除了它(apt get remove 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.

我很好奇哪个程序在Debian上调用dhclient

我怀疑是NetworkManager,但不是真的。 因为我已经删除了它(apt get remove 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 Squence上调用dhclient程序?

您必须禁用dhcp并为接口设置静态ip地址

这可以在/etc/network/interfaces

更改:

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


重新启动后,dhclient应该消失。

ifupdown
(配置文件:
/etc/network/interfaces
)。

它在ifupdown中编码

下载源和

制作inet.c

检查dhcp_up()函数:


我知道如何设置静态ip。我的问题是哪个程序调用dhclient程序?有趣的是,这实际上似乎并没有杀死dhclient。。。这是如果您不重新启动服务器。
# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0
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;
}