dhcpcd icon indicating copy to clipboard operation
dhcpcd copied to clipboard

dhcpcd expires lease when config file changes

Open Sateesh-Patil opened this issue 9 months ago • 11 comments

Hi Team,

We wanted to update the configuration details to the DHCP server like, hostname and domain name during the bootup with dhcpcd rebind. So Is there any way to trigger dhcpcd rebind without releasing existing IP to just update the details to DHCP server.?

curerently rebind will trigger DEL_ADDR followed by NEW_ADDR event.

Regards, Sateesh R Patil

Sateesh-Patil avatar Mar 10 '25 10:03 Sateesh-Patil

Huh? dhcpcd will only release on rebind when NAKed by the server. On the happy path a rebind will not delete any IP address.

rsmarples avatar Mar 10 '25 11:03 rsmarples

dhcpcd --rebind eth0 #:dhcpcd --rebind eth0 #:sending signal HUP to pid 1457 #:[root@SampleHostName ]# #:Deleted 2: eth0 inet6 2001::9f:5cc9:2ea:103a/128 scope global dynamic noprefixroute #: valid_lft 3474sec preferred_lft 174sec #:Deleted local 2001::9f:5cc9:2ea:103a dev eth0 proto kernel metric 0 pref medium #:Deleted 2: eth0 inet 192.168.1.14/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0 #: valid_lft 2861sec preferred_lft 2411sec #:Deleted broadcast 192.168.1.255 dev eth0 table local proto kernel scope link src 192.168.1.14 #:Deleted broadcast 192.168.1.0 dev eth0 table local proto kernel scope link src 192.168.1.14 #:Deleted local 192.168.1.14 dev eth0 table local proto kernel scope host src 192.168.1.14 #:Deleted 192.168.111.122 dev eth0 scope link src 192.168.1.14 metric 1002 #:Deleted 192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.14 metric 1002 #:Deleted default via 192.168.111.122 dev eth0 proto dhcp src 192.168.1.14 metric 1002 #:Deleted 192.168.1.6 dev eth0 lladdr 00:0c:29:7b:5f:62 STALE #:Deleted 192.168.1.5 dev eth0 lladdr 00:1f:29:05:5c:dc REACHABLE #:Deleted 192.168.111.122 dev eth0 FAILED #:Deleted 192.168.1.1 dev eth0 lladdr 24:f5:a2:27:04:c8 STALE #:Deleted 224.0.0.252 dev eth0 lladdr 01:00:5e:00:00:fc NOARP #:Deleted 239.255.255.250 dev eth0 lladdr 01:00:5e:7f:ff:fa NOARP #:Deleted 224.0.0.251 dev eth0 lladdr 01:00:5e:00:00:fb NOARP #:Deleted 224.0.0.2 dev eth0 lladdr 01:00:5e:00:00:02 NOARP #:Deleted 192.168.1.16 dev eth0 lladdr e8:39:35:30:27:88 STALE #:Deleted 224.0.1.60 dev eth0 lladdr 01:00:5e:00:01:3c NOARP #:169.254.0.0/16 dev eth0 scope link metric 1001 #:2: eth0 inet6 2001::9f:5cc9:2ea:103a/128 scope global tentative dynamic noprefixroute #: valid_lft 3600sec preferred_lft 300sec #:2: eth0 inet6 2001::9f:5cc9:2ea:103a/128 scope global dynamic noprefixroute #: valid_lft 3599sec preferred_lft 299sec #:local 2001::9f:5cc9:2ea:103a dev eth0 proto kernel metric 0 pref medium #:2: eth0 inet 192.168.1.14/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0 #: valid_lft 3600sec preferred_lft 3150sec

After sending rebind command, we are getting DEL_ADDR followed by NEW_ADDR from netlink.

Sateesh-Patil avatar Mar 10 '25 13:03 Sateesh-Patil

How do you know dhcpcd is doing that? Can you post a debug log of dhcpcd showing what it does during a rebind please?

rsmarples avatar Mar 10 '25 16:03 rsmarples

I can see above DEL_ADDR followed by NEW_ADDR in ip monitor log after doing 'dhcpcd --rebind eth0' and looks like config is reloading but not sure what internally dhcpcd does.

Please find the below dhcpcd log

cat dhcpcd.log #:cat dhcpcd.log #:Mar 11 02:30:50 [1471]: dhcpcd-10.0.10 starting #:Mar 11 02:30:50 [1471]: chrooting as dhcpcd to /var/lib/dhcpcd #:Mar 11 02:30:50 [1471]: sandbox: seccomp #:Mar 11 02:30:50 [1483]: spawned manager process on PID 1483 #:Mar 11 02:30:50 [1483]: spawned privileged proxy on PID 1485 #:Mar 11 02:30:50 [1483]: spawned network proxy on PID 1486 #:Mar 11 02:30:50 [1483]: spawned controller proxy on PID 1487 #:Mar 11 02:30:50 [1483]: DUID 00:01:00:01:2e:4f:17:b9:2c:58:b9:60:25:23 #:Mar 11 02:30:51 [1471]: forked to background #:Mar 11 02:30:51 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks PREINIT #:Mar 11 02:30:51 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks CARRIER #:Mar 11 02:30:51 [1562]: dhcpcd-10.0.10 starting #:Mar 11 02:30:51 [1562]: chrooting as dhcpcd to /var/lib/dhcpcd #:Mar 11 02:30:51 [1562]: sandbox: seccomp #:Mar 11 02:30:51 [1570]: spawned manager process on PID 1570 #:Mar 11 02:30:51 [1570]: spawned privileged proxy on PID 1571 #:Mar 11 02:30:51 [1570]: spawned network proxy on PID 1572 #:Mar 11 02:30:51 [1570]: spawned controller proxy on PID 1573 #:Mar 11 02:30:51 [1570]: DUID 00:01:00:01:2e:4f:17:b9:2c:58:b9:60:25:23 #:Mar 11 02:30:51 [1483]: eth0: IAID b9:60:25:24 #:Mar 11 02:30:51 [1483]: eth0: delaying DHCPv6 for LL address #:Mar 11 02:30:51 [1483]: eth0: delaying IPv4 for 0.3 seconds #:Mar 11 02:30:51 [1483]: eth0: using ClientID 01:2c:58:b9:60:25:24 #:Mar 11 02:30:51 [1483]: eth0: reading lease: /var/lib/dhcpcd/eth0.lease #:Mar 11 02:30:51 [1483]: eth0: soliciting a DHCP lease #:Mar 11 02:30:51 [1485]: eth0: spawned BPF BOOTP on PID 1618 #:Mar 11 02:30:51 [1483]: eth0: sending DISCOVER (xid 0xc4cbdbd1), next in 3.5 seconds #:Mar 11 02:30:51 [1483]: eth0: offered 192.168.1.14 from 192.168.1.6 #:Mar 11 02:30:51 [1485]: eth0: process BPF BOOTP already started on pid 1618 #:Mar 11 02:30:51 [1483]: eth0: sending REQUEST (xid 0xc4cbdbd1), next in 3.9 seconds #:Mar 11 02:30:51 [1483]: eth0: acknowledged 192.168.1.14 from 192.168.1.6 #:Mar 11 02:30:51 [1485]: eth0: spawned BPF ARP 192.168.1.14 on PID 1649 #:Mar 11 02:30:51 [1483]: eth0: probing address 192.168.1.14/24 #:Mar 11 02:30:51 [1483]: eth0: probing for 192.168.1.14 #:Mar 11 02:30:51 [1483]: eth0: ARP probing 192.168.1.14 (1 of 3), next in 1.1 seconds #:Mar 11 02:30:52 [1570]: wlan0: executing: /usr/libexec/dhcpcd-run-hooks PREINIT #:Mar 11 02:30:52 [1562]: forked to background #:Mar 11 02:30:52 [1570]: wlan0: executing: /usr/libexec/dhcpcd-run-hooks NOCARRIER #:Mar 11 02:30:52 [1570]: wlan0: waiting for carrier #:Mar 11 02:30:52 [1483]: eth0: reading lease: /var/lib/dhcpcd/eth0.lease6 #:Mar 11 02:30:52 [1483]: eth0: soliciting a DHCPv6 lease #:Mar 11 02:30:52 [1485]: eth0: spawned DHCP6 proxy fe80::2e58:b9ff:fe60:2524 on PID 1763 #:Mar 11 02:30:52 [1483]: eth0: delaying SOLICIT6 (xid 0xd9e0d8), next in 1.0 seconds #:Mar 11 02:30:52 [1483]: eth0: ARP probing 192.168.1.14 (2 of 3), next in 1.7 seconds #:Mar 11 02:30:53 [1483]: eth0: multicasting SOLICIT6 (xid 0xd9e0d8), next in 1.1 seconds #:Mar 11 02:30:53 [1483]: eth0: ADV 2001::29da:538d:e79e:c526/128 from 2001::1234 #:Mar 11 02:30:54 [1483]: eth0: ARP probing 192.168.1.14 (3 of 3), next in 2.0 seconds #:Mar 11 02:30:54 [1483]: eth0: multicasting REQUEST6 (xid 0x9b31f6), next in 1.1 seconds #:Mar 11 02:30:54 [1483]: eth0: REPLY6 received from 2001::1234 #:Mar 11 02:30:54 [1483]: eth0: adding address 2001::29da:538d:e79e:c526/128 #:Mar 11 02:30:54 [1483]: eth0: pltime 300 seconds, vltime 3600 seconds #:Mar 11 02:30:54 [1483]: eth0: renew in 150, rebind in 240, expire in 3600 seconds #:Mar 11 02:30:54 [1483]: eth0: writing lease: /var/lib/dhcpcd/eth0.lease6 #:Mar 11 02:30:54 [1483]: eth0: waiting for DHCPv6 DAD to complete #:Mar 11 02:30:54 [1485]: eth0: spawned DHCP6 proxy 2001::2e58:b9ff:fe60:2524 on PID 1777 #:Mar 11 02:30:55 [1485]: eth0: spawned DHCP6 proxy 2001::29da:538d:e79e:c526 on PID 1787 #:Mar 11 02:30:55 [1483]: eth0: DHCPv6 DAD completed #:Mar 11 02:30:55 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks BOUND6 #:Mar 11 02:30:56 [1483]: eth0: DAD completed for 192.168.1.14 #:Mar 11 02:30:56 [1483]: eth0: leased 192.168.1.14 for 3600 seconds #:Mar 11 02:30:56 [1483]: eth0: renew in 1800 seconds, rebind in 3150 seconds #:Mar 11 02:30:56 [1483]: eth0: writing lease: /var/lib/dhcpcd/eth0.lease #:Mar 11 02:30:56 [1483]: eth0: adding IP address 192.168.1.14/24 broadcast 192.168.1.255 #:Mar 11 02:30:56 [1483]: eth0: router 192.168.111.122 requires a host route #:Mar 11 02:30:56 [1483]: eth0: adding route to 192.168.1.0/24 #:Mar 11 02:30:56 [1483]: eth0: adding host route to 192.168.111.122 #:Mar 11 02:30:56 [1483]: eth0: adding default route via 192.168.111.122 #:Mar 11 02:30:56 [1483]: eth0: ARP announcing 192.168.1.14 (1 of 2), next in 2.0 seconds #:Mar 11 02:30:56 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks BOUND #:Mar 11 02:30:56 [1485]: eth0: spawned BOOTP proxy 192.168.1.14 on PID 1877 #:Mar 11 02:30:56 [1485]: eth0: BPF BOOTP exited from PID 1618 #:Mar 11 02:30:58 [1483]: eth0: ARP announcing 192.168.1.14 (2 of 2) #:Mar 11 02:30:59 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:30:59 [1570]: control command: dhcpcd -q -U wlan0 #:Mar 11 02:30:59 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:30:59 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:30:59 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:00 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:06 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:06 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:06 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:06 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:06 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:06 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:09 [2181]: sending signal HUP to pid 1483 #:Mar 11 02:31:09 [1483]: received SIGHUP, rebinding #:Mar 11 02:31:09 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks RECONFIGURE #:Mar 11 02:31:09 [2187]: sending signal HUP to pid 1570 #:Mar 11 02:31:09 [1570]: received SIGHUP, rebinding #:Mar 11 02:31:09 [1570]: wlan0: executing: /usr/libexec/dhcpcd-run-hooks RECONFIGURE #:Mar 11 02:31:09 [1483]: eth0: config file changed, expiring leases #:Mar 11 02:31:09 [1483]: eth0: deleting address 2001::29da:538d:e79e:c526/128 #:Mar 11 02:31:09 [1483]: eth0: router 192.168.111.122 requires a host route #:Mar 11 02:31:09 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks EXPIRE6 #:Mar 11 02:31:09 [1570]: wlan0: config file changed, expiring leases #:Mar 11 02:31:09 [1570]: wlan0: waiting for carrier #:Mar 11 02:31:09 [1485]: eth0: DHCP6 proxy 2001::29da:538d:e79e:c526 exited from PID 1787 #:Mar 11 02:31:09 [1483]: eth0: deleting IP address 192.168.1.14/24 #:Mar 11 02:31:09 [1483]: eth0: deleting host route to 192.168.111.122 #:Mar 11 02:31:09 [1483]: eth0: deleting route to 192.168.1.0/24 #:Mar 11 02:31:09 [1483]: eth0: deleting default route via 192.168.111.122 #:Mar 11 02:31:09 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks EXPIRE #:Mar 11 02:31:09 [1485]: eth0: BPF ARP 192.168.1.14 exited from PID 1649 #:Mar 11 02:31:09 [1483]: eth0: IAID b9:60:25:24 #:Mar 11 02:31:09 [1483]: eth0: reading lease: /var/lib/dhcpcd/eth0.lease6 #:Mar 11 02:31:09 [1483]: eth0: confirming prior DHCPv6 lease #:Mar 11 02:31:09 [1483]: eth0: delaying CONFIRM6 (xid 0x2087f2), next in 1.0 seconds #:Mar 11 02:31:09 [1483]: eth0: delaying IPv4 for 0.8 seconds #:Mar 11 02:31:10 [1483]: eth0: using ClientID 01:2c:58:b9:60:25:24 #:Mar 11 02:31:10 [1483]: eth0: reading lease: /var/lib/dhcpcd/eth0.lease #:Mar 11 02:31:10 [1483]: eth0: rebinding lease of 192.168.1.14 #:Mar 11 02:31:10 [1485]: eth0: spawned BPF ARP 192.168.1.14 on PID 2321 #:Mar 11 02:31:10 [1483]: eth0: sending REQUEST (xid 0xb26bfaf8), next in 3.3 seconds #:Mar 11 02:31:10 [1485]: eth0: spawned BPF BOOTP on PID 2322 #:Mar 11 02:31:10 [1483]: eth0: acknowledged 192.168.1.14 from 192.168.1.6 #:Mar 11 02:31:10 [1483]: eth0: probing address 192.168.1.14/24 #:Mar 11 02:31:10 [1483]: eth0: probing for 192.168.1.14 #:Mar 11 02:31:10 [1483]: eth0: ARP probing 192.168.1.14 (1 of 3), next in 1.6 seconds #:Mar 11 02:31:10 [1483]: eth0: multicasting CONFIRM6 (xid 0x2087f2), next in 1.0 seconds #:Mar 11 02:31:10 [1483]: eth0: REPLY6 received from 2001::1234 #:Mar 11 02:31:10 [1483]: eth0: adding address 2001::29da:538d:e79e:c526/128 #:Mar 11 02:31:10 [1483]: eth0: pltime 300 seconds, vltime 3600 seconds #:Mar 11 02:31:10 [1483]: eth0: renew in 134, rebind in 224, expire in 3584 seconds #:Mar 11 02:31:10 [1483]: eth0: waiting for DHCPv6 DAD to complete #:Mar 11 02:31:10 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:10 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:12 [1483]: eth0: ARP probing 192.168.1.14 (2 of 3), next in 1.7 seconds #:Mar 11 02:31:12 [1485]: eth0: spawned DHCP6 proxy 2001::29da:538d:e79e:c526 on PID 2331 #:Mar 11 02:31:12 [1483]: eth0: DHCPv6 DAD completed #:Mar 11 02:31:12 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks REBOOT6 #:Mar 11 02:31:12 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:12 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:12 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:12 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:12 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:12 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:13 [1483]: eth0: ARP probing 192.168.1.14 (3 of 3), next in 2.0 seconds #:Mar 11 02:31:15 [1483]: eth0: DAD completed for 192.168.1.14 #:Mar 11 02:31:15 [1483]: eth0: leased 192.168.1.14 for 3600 seconds #:Mar 11 02:31:15 [1483]: eth0: renew in 1800 seconds, rebind in 3150 seconds #:Mar 11 02:31:15 [1483]: eth0: writing lease: /var/lib/dhcpcd/eth0.lease #:Mar 11 02:31:15 [1483]: eth0: adding IP address 192.168.1.14/24 broadcast 192.168.1.255 #:Mar 11 02:31:15 [1483]: eth0: router 192.168.111.122 requires a host route #:Mar 11 02:31:15 [1483]: eth0: adding route to 192.168.1.0/24 #:Mar 11 02:31:15 [1483]: eth0: adding host route to 192.168.111.122 #:Mar 11 02:31:15 [1483]: eth0: adding default route via 192.168.111.122 #:Mar 11 02:31:15 [1483]: eth0: ARP announcing 192.168.1.14 (1 of 2), next in 2.0 seconds #:Mar 11 02:31:15 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks BOUND #:Mar 11 02:31:15 [1485]: eth0: spawned BOOTP proxy 192.168.1.14 on PID 2502 #:Mar 11 02:31:15 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:15 [1485]: eth0: BOOTP proxy 192.168.1.14 exited from PID 1877 #:Mar 11 02:31:15 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:15 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:15 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:15 [1485]: eth0: BPF BOOTP exited from PID 2322 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:16 [1483]: control command: dhcpcd -q -U eth0 #:Mar 11 02:31:17 [1483]: eth0: ARP announcing 192.168.1.14 (2 of 2) #:Mar 11 02:33:24 [1483]: eth0: multicasting RENEW6 (xid 0x0196fd), next in 10.5 seconds #:Mar 11 02:33:24 [1483]: eth0: REPLY6 received from 2001::1234 #:Mar 11 02:33:24 [1483]: eth0: adding address 2001::29da:538d:e79e:c526/128 #:Mar 11 02:33:24 [1483]: eth0: pltime 300 seconds, vltime 3600 seconds #:Mar 11 02:33:24 [1483]: eth0: renew in 150, rebind in 240, expire in 3600 seconds #:Mar 11 02:33:24 [1483]: eth0: writing lease: /var/lib/dhcpcd/eth0.lease6 #:Mar 11 02:33:24 [1483]: eth0: executing: /usr/libexec/dhcpcd-run-hooks RENEW6 #:Mar 11 02:33:25 [1485]: eth0: process DHCP6 proxy 2001::29da:538d:e79e:c526 already started on pid 2331 #:Mar 11 02:34:46 [1485]: eth0: process DHCP6 proxy 2001::2e58:b9ff:fe60:2524 already started on pid 1777

Sateesh-Patil avatar Mar 11 '25 02:03 Sateesh-Patil

From your log: eth0: config file changed, expiring leases

So now the question - why are you changing the config file?

rsmarples avatar Mar 11 '25 10:03 rsmarples

We do update user/admin configuration like hostname, domain name, and FQDN configurations in the dhcpcd.conf file, and to update the DHCP server for these updates, we triggering 'dhcpcd rebind' as this will reload the configuration and send update to dhcp server.

Sateesh-Patil avatar Mar 11 '25 10:03 Sateesh-Patil

Any option to trigger rebind without loosing ip address?

Sateesh-Patil avatar Mar 13 '25 14:03 Sateesh-Patil

The only option right now is to not change the config file. We do this so we can remove static config which is no longer set and this would need to be addressed at a minimum before looking at changing this behavior.

rsmarples avatar Mar 13 '25 17:03 rsmarples

Currently, we do need to update in the conf file for manual configuration hostname/domain name and send updates to dhcp server, so rebind only the option. If not we will end up with not updating the current configuration to dhcp server and device will not have proper sync with server its connected.

Sateesh-Patil avatar Mar 13 '25 18:03 Sateesh-Patil

Why can't you set the hostname using the hostname command? If dhcpcd has the hostname option set without a string afterwards it will send the hostname as set, including any domain. You shouldn't need to keep changing dhcpcd.conf

rsmarples avatar Mar 13 '25 21:03 rsmarples

Why can't you set the hostname using the hostname command? If dhcpcd has the hostname option set without a string afterwards it will send the hostname as set, including any domain. You shouldn't need to keep changing dhcpcd.conf

-- @rsmarples - Any update configuration for hostname and domain name. We do need to update the conf file for a manual configuration and send updates to the DHCP server, so rebind is the only option. Otherwise, we have to wait till the next rebind based on the lease. If there is a long lease , then it will be too late to update to the server, and we will end up with not updating the current configuration to the DHCP server and the device will not have proper sync with the server that is connected.

Currently, we have seen the error below and the dhcpcd process getting hang and ending up with no IP address after rebinding during the simulator boot. Once it hangs, there is no option to start it back and only a further reboot is required.

Log1 Dec 01 17:39:46 [1315]: sending signal HUP to pid 695 Dec 01 17:39:46 [695]: received SIGHUP, rebinding Dec 01 17:39:46 [695]: eth0: executing: /usr/libexec/dhcpcd-run-hooks RECONFIGURE Dec 01 17:39:46 [695]: eth0: config file changed, expiring leases Dec 01 17:39:46 [695]: eth0: deleting IP address 192.168.1.180/24 Dec 01 17:39:46 [695]: eth0: deleting route to 192.168.1.0/24 Dec 01 17:39:46 [695]: eth0: deleting default route via 192.168.1.1 Dec 01 17:39:46 [695]: eth0: executing: /usr/libexec/dhcpcd-run-hooks EXPIRE Dec 01 17:39:46 [696]: ps_root_writeerror: result=0, data=(nil), len=0: Broken pipe Dec 01 17:39:46 [696]: ps_root_recvmsg: Broken pipe Dec 01 17:39:46 [695]: script_runreason: No such process

Log2 Nov 11 05:53:23 [1182]: dhcpcd-10.0.10 starting Nov 11 05:53:23 [1182]: chrooting as dhcpcd to /var/lib/dhcpcd Nov 11 05:53:23 [1182]: sandbox: seccomp Nov 11 05:53:23 [1184]: spawned manager process on PID 1184 Nov 11 05:53:23 [1184]: spawned privileged proxy on PID 1185 Nov 11 05:53:23 [1184]: spawned network proxy on PID 1186 Nov 11 05:53:23 [1184]: spawned controller proxy on PID 1187 Nov 11 05:53:23 [1184]: DUID 00:01:00:01:30:a5:84:77:52:54:cb:00:76:b5 Nov 11 05:53:23 [1190]: sending signal HUP to pid 1184 Nov 11 05:53:23 [1184]: received SIGHUP, rebinding Nov 11 05:53:23 [1182]: dhcpcd_fork_cb: dhcpcd manager hungup Nov 11 05:53:23 [1185]: ps_root_recvmsg: Connection reset by peer

Sateesh-Patil avatar Dec 08 '25 06:12 Sateesh-Patil