2017-03-08 15:24 GMT+08:00 Clark Wang <[email protected]>:

> See following output from my system (Debian 8.6):
>
>     root@debian:~# cat /etc/debian_version
>     8.6
>     root@debian:~# pgrep -af dhc
>     506 dhclient -v -pf /run/dhclient.eth1.pid -lf
> /var/lib/dhcp/dhclient.eth1.leases eth1
>     447 dhclient -v -pf /run/dhclient.eth0.pid -lf
> /var/lib/dhcp/dhclient.eth0.leases eth0
>     601 dhclient -v -pf /run/dhclient.eth0.pid -lf
> /var/lib/dhcp/dhclient.eth0.leases eth0
>     664 dhclient -6 -pf /run/dhclient6.eth0.pid -lf
> /var/lib/dhcp/dhclient6.eth0.leases eth0
>     root@debian:~# grep -n -C3 eth0 /etc/network/interfaces
>      7-auto lo
>      8-iface lo inet loopback
>      9-
>     10:allow-hotplug eth0
>     11:iface eth0 inet dhcp
>     12:iface eth0 inet6 dhcp
>     13-    accept_ra 1
>     14-
>     15-allow-hotplug eth1
>     root@debian:~#
>
> There are 2 `dhclient` processes running for `eth0` (IPv4). Rebooting does
> not help for me.
>

Thanks all for pointing me to the debug direction.

I moved /sbin/dhclient to /sbin/dhclient.bin and rewrite /sbin/dhclient as
a shell script which would call /sbin/dhclient.bin and prints some proc
hierarchy info. It turned out both /etc/init.d/networking and systemd would
call ifup. See following example (only for IPv4):

==== Sun Mar 12 21:38:08 PDT 2017 ====
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       433  0.0  1.1  20052  2880 ?        S    21:38   0:00 /bin/bash
/sbin/dhclient -v -pf /run/dhclient.eth0.pid -lf
/var/lib/dhcp/dhclient.eth0.leases eth0
systemd(1)-+-networking(285)---ifup(427)---sh(432)---dhclient(433)---pstree(441)
           |-systemd-journal(160)
           `-systemd-udevd(164)-+-systemd-udevd(167)
                                |-systemd-udevd(171)
                                |-systemd-udevd(172)
                                |-systemd-udevd(173)
                                |-systemd-udevd(174)
                                |-systemd-udevd(175)
                                |-systemd-udevd(176)
                                |-systemd-udevd(177)
                                |-systemd-udevd(178)
                                `-systemd-udevd(179)

==== Sun Mar 12 21:38:10 PDT 2017 ====
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       518  0.0  1.1  20052  2920 ?        S    21:38   0:00 /bin/bash
/sbin/dhclient -v -pf /run/dhclient.eth0.pid -lf
/var/lib/dhcp/dhclient.eth0.leases eth0
systemd(1)-+-dhclient.bin(457)
           |-ifup(509)---sh(517)---dhclient(518)---pstree(522)
           |-nfs-common(512)---nfs-common(523)
           |-systemd-journal(160)
           `-systemd-udevd(164)-+-systemd-udevd(167)
                                |-systemd-udevd(171)
                                |-systemd-udevd(172)
                                |-systemd-udevd(173)
                                |-systemd-udevd(174)
                                |-systemd-udevd(175)
                                |-systemd-udevd(176)
                                |-systemd-udevd(177)
                                |-systemd-udevd(178)
                                `-systemd-udevd(179)

I know nothing about systemd so I disabled the "networking" service with
"sysv-rc-conf" but then network would not be up after reboot. So how can I
make sure only "systemd" or the "networking" service would bring network up?

-clark

Reply via email to