Skip to content

Commit

Permalink
[pd] ensure dhcp6_pd_daemon starts after otbr-agent (#2600)
Browse files Browse the repository at this point in the history
The `dhcp6_pd_daemon` occasionally fails to receive dbus messages on
initial boot due to a race condition with `otbr-agent`.  This commit
fixes the issue by explicitly defining a service dependency on
`otbr-agent`.
  • Loading branch information
yangsong-cnyn authored Nov 14, 2024
1 parent 4589255 commit 094d0cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script/_dhcpv6_pd_ref
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ create_dhcp6_pd_daemon_service()
sudo tee ${PD_DAEMON_SERVICE_PATH} <<EOF
[Unit]
Description=Daemon to manage dhcpcd based on otbr-agent's PD state change
After=multi-user.service
ConditionPathExists=${PD_DAEMON_PATH}
Requires=otbr-agent.service
After=otbr-agent.service
[Service]
Type=simple
Expand Down

1 comment on commit 094d0cc

@pac8086
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems to break a clean first time build (when otbr-agent doesn't exist on the platform and has never been compiled).
./script/setup - fails as follows
[Install]
WantedBy=multi-user.target

  • have systemctl
  • command -v systemctl
  • sudo systemctl daemon-reload
  • sudo systemctl enable dhcp6_pd_daemon.service
    Created symlink /etc/systemd/system/multi-user.target.wants/dhcp6_pd_daemon.service → /etc/systemd/system/dhcp6_pd_daemon.service.
  • sudo systemctl start dhcp6_pd_daemon.service
    Failed to start dhcp6_pd_daemon.service: Unit otbr-agent.service not found.

Please sign in to comment.