Skip to content

Commit faba904

Browse files
Zheyu ShenColtonPaul
authored andcommitted
make openibd more robust
1 parent 33bb777 commit faba904

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

components/install_doca.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@ write_component_version "DOCA" $DOCA_VERSION
4444
OFED_VERSION=$(ofed_info | sed -n '1,1p' | awk -F'-' 'OFS="-" {print $3,$4}' | tr -d ':')
4545
write_component_version "OFED" $OFED_VERSION
4646

47+
# Create systemd drop-in configuration for openibd.service
48+
# This adds restart on failure and ensures it starts after udev settles
49+
mkdir -p /etc/systemd/system/openibd.service.d
50+
cat > /etc/systemd/system/openibd.service.d/override.conf <<EOF
51+
[Unit]
52+
After=systemd-udev-settle.service
53+
Wants=systemd-udev-settle.service
54+
55+
[Service]
56+
Restart=on-failure
57+
RestartSec=5
58+
EOF
59+
60+
systemctl daemon-reload
61+
systemctl enable openibd
62+
4763
/etc/init.d/openibd restart
4864
/etc/init.d/openibd status
4965
error_code=$?

components/install_mofed.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,18 @@ echo "INSTALLED MOFED!! Release Version: ${MOFED_VERSION}, Source Version: ${SOU
8989
# Therefore, though we use release version in versions.json for tdnf install, we need to write the SOURCE_VERSION to the component version file.
9090
write_component_version "OFED" $SOURCE_VERSION
9191

92+
# Create systemd drop-in configuration for openibd.service
93+
# This adds restart on failure and ensures it starts after udev settles
94+
mkdir -p /etc/systemd/system/openibd.service.d
95+
cat > /etc/systemd/system/openibd.service.d/override.conf <<EOF
96+
[Unit]
97+
After=systemd-udev-settle.service
98+
Wants=systemd-udev-settle.service
99+
100+
[Service]
101+
Restart=on-failure
102+
RestartSec=5
103+
EOF
104+
105+
systemctl daemon-reload
92106
systemctl enable openibd

0 commit comments

Comments
 (0)