dhclient process lifetime

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

dhclient process lifetime

Lukas Erlacher
Hallo,

I hope this is the correct place for isc-dhcp-client (dhclient) issues.

I do not understand why dhclient behaves the way it does vis-a-vis
process lifetime and hope someone can explain it to me.

I am running isc-dhcp-client 4.3.5-3 on Raspbian 9.3.

When I run this twice:

> dhclient -v -4 -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0

Two dhclient processes will be running. That seems very undesirable,
especially since I've already observed a corrupted leasefile that had
interleaved writes.

If I want to make sure that only one dhclient process is running for an
interface, it appears I first have to run dhclient -x to make sure any
running process gets killed.

Is this normal/intended behaviour?

Thanks,
Luke


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dhclient process lifetime

Pavel Zhukov
Lukas Erlacher <[hidden email]> writes:
Hello,

You have see something like
# dhclient -v -4 -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases client1
dhclient(30189) is already running - exiting.

the pid (30189) is stored in  /run/dhclient.eth0.pid and it prevent
second copy of dhclient to be started as it was been
specified in your command line. Can you check/share content of this
file?

> Hallo,
>
> I hope this is the correct place for isc-dhcp-client (dhclient) issues.
>
> I do not understand why dhclient behaves the way it does vis-a-vis
> process lifetime and hope someone can explain it to me.
>
> I am running isc-dhcp-client 4.3.5-3 on Raspbian 9.3.
>
> When I run this twice:
>
>> dhclient -v -4 -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
>
> Two dhclient processes will be running. That seems very undesirable,
> especially since I've already observed a corrupted leasefile that had
> interleaved writes.
>
> If I want to make sure that only one dhclient process is running for an
> interface, it appears I first have to run dhclient -x to make sure any
> running process gets killed.
>
> Is this normal/intended behaviour?
>
> Thanks,
> Luke
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: dhclient process lifetime

Lukas Erlacher
Hi Pavel,

thanks for your reply.

In fact, I see no such message. Here is what I see:

> (testenv) root@manarati-two:~# pgrep -a dhclient                                                                                                                                                                                              
> (testenv) root@manarati-two:~# cat /run/dhclient.eth0.pid
> 29121
> (testenv) root@manarati-two:~# dhclient -v -w -4 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
> Internet Systems Consortium DHCP Client 4.3.5
> Copyright 2004-2016 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
>
> Listening on LPF/eth0/b8:27:eb:be:35:8a
> Sending on   LPF/eth0/b8:27:eb:be:35:8a
> Sending on   Socket/fallback
> DHCPREQUEST of 192.168.13.151 on eth0 to 255.255.255.255 port 67
> DHCPACK of 192.168.13.151 from 192.168.13.1
> RTNETLINK answers: File exists
> bound to 192.168.13.151 -- renewal in 789 seconds.
> (testenv) root@manarati-two:~# pgrep -a dhclient
> 10875 dhclient -v -w -4 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
> (testenv) root@manarati-two:~# cat /run/dhclient.eth0.pid
> 10875
> (testenv) root@manarati-two:~# dhclient -v -w -4 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
> Internet Systems Consortium DHCP Client 4.3.5
> Copyright 2004-2016 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
>
> Listening on LPF/eth0/b8:27:eb:be:35:8a
> Sending on   LPF/eth0/b8:27:eb:be:35:8a
> Sending on   Socket/fallback
> DHCPREQUEST of 192.168.13.151 on eth0 to 255.255.255.255 port 67
> DHCPACK of 192.168.13.151 from 192.168.13.1
> RTNETLINK answers: File exists
> bound to 192.168.13.151 -- renewal in 729 seconds.
> (testenv) root@manarati-two:~# pgrep -a dhclient
> 10875 dhclient -v -w -4 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
> 10902 dhclient -v -w -4 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
> (testenv) root@manarati-two:~# cat /run/dhclient.eth0.pid
> 10902
> (testenv) root@manarati-two:~#
So for some reason dhclient is not performing the check for a running
instance correctly.

On 02/07/2018 02:23 AM, Pavel Zhukov wrote:

> Lukas Erlacher <[hidden email]> writes:
> Hello,
>
> You have see something like
> # dhclient -v -4 -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases client1
> dhclient(30189) is already running - exiting.
>
> the pid (30189) is stored in  /run/dhclient.eth0.pid and it prevent
> second copy of dhclient to be started as it was been
> specified in your command line. Can you check/share content of this
> file?
>

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dhclient process lifetime

Lukas Erlacher
Hello,

I apologize for the content-less bump, but I'd like to restate my
problem, since it seems like it hasn't been seen by anyone.

dhclient 4.3.5 (isc-dhcp-client 4.3.5-3 on Raspbian 9.3) does not
recognize that another dhclient process is already running. I never see the

> dhclient(30189) is already running - exiting

Message when invoking dhclient twice with the same pid file.

Is this a known bug?

Best,
Luke


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

smime.p7s (6K) Download Attachment