forked from dentproject/dentOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add switchdev-online service to hold off on network init (dentproject#56
) * Add switchdev-online service to hold off on network init The addresses a race condition between the switchdev driver, udev and ifupdown2. In some cases, ifupdown2 attempts to configure switchdev interfaces (1) before they are ready, or (2) before any udev rules have had a chance to rename them per udev configuration. When this happens, not all interfaces are configured correctly. The solution is to 1. create a dummy systemd service for each switchdev interface (platform specific) that depends on the well-known systemd device path for that netdev (currently 'sys-subsystem-net-devices-FOO.device'. 2. Make the system-wide network-pre.service depend on *all* switchdev devices coming online 3. make ifupdown2 (via networking.service) depend on network-pre.service See https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ Signed-off-by: Carl Roth <rothcar@amazon.com> * update line ending per review Signed-off-by: Carl Roth <rothcar@amazon.com> * Add switchdev-online support for Delta tn48m-dn platforms - based on fixes for non-DN systems - please check my work, I don't have physical access to these systems to verify port count Signed-off-by: Carl Roth <rothcar@amazon.com> * spray for spelling, per review Signed-off-by: Carl Roth <rothcar@amazon.com>
- Loading branch information
Showing
12 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
...otfs/stretch/common/overlay/etc/systemd/system/networking.service.d/switchdev-online.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[Unit] | ||
After=network-pre.target |
20 changes: 20 additions & 0 deletions
20
builds/any/rootfs/stretch/common/overlay/etc/systemd/system/switchdev-online@.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=Online state for switchdev device %i | ||
|
||
# See e.g. | ||
# https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ | ||
Wants=network-pre.target | ||
Before=network-pre.target | ||
|
||
# this is the naming scheme currently used for network devices | ||
Wants=sys-subsystem-net-devices-%i.device | ||
After=sys-subsystem-net-devices-%i.device | ||
|
||
[Service] | ||
Type=simple | ||
RemainAfterExit=yes | ||
ExecStart=/bin/true | ||
TimeoutStartSec=30 | ||
|
||
[Install] | ||
WantedBy=network.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters