File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,13 @@ case "$1" in
66 configure)
77 /usr/bin/nvidia-ctk --quiet config --config-file=/etc/nvidia-container-runtime/config.toml --in-place
88
9+ # Enable nvidia-cdi-refresh services on both install and upgrade
910 if command -v systemctl > /dev/null 2>&1 \
1011 && systemctl --quiet is-system-running 2> /dev/null; then
1112
12- systemctl daemon-reload || true
13-
14- if [ -z " $2 " ]; then # $2 empty → first install
15- systemctl enable --now nvidia-cdi-refresh.path || true
16- fi
13+ systemctl daemon-reload || echo " Warning: Failed to reload systemd daemon" >&2
14+ systemctl enable --now nvidia-cdi-refresh.path || echo " Warning: Failed to enable nvidia-cdi-refresh.path" >&2
15+ systemctl enable --now nvidia-cdi-refresh.service || echo " Warning: Failed to enable nvidia-cdi-refresh.service" >&2
1716 fi
1817 ;;
1918
Original file line number Diff line number Diff line change @@ -51,15 +51,12 @@ if [ $1 -gt 1 ]; then # only on package upgrade
5151 cp -af %{_bindir}/nvidia-container-runtime-hook %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit
5252fi
5353
54- # Reload systemd unit cache
54+ # Reload systemd unit cache and enable nvidia-cdi-refresh services on both install and upgrade
5555if command -v systemctl > /dev/null 2> &1 \
5656 && systemctl --quiet is-system-running 2> /dev/null; then
57- systemctl daemon-reload || true
58-
59- # On fresh install ($1 == 1) enable the path unit so it starts at boot
60- if [ "$1" -eq 1 ]; then
61- systemctl enable --now nvidia-cdi-refresh.path || true
62- fi
57+ systemctl daemon-reload || echo "Warning: Failed to reload systemd daemon" > &2
58+ systemctl enable --now nvidia-cdi-refresh.path || echo "Warning: Failed to enable nvidia-cdi-refresh.path" > &2
59+ systemctl enable --now nvidia-cdi-refresh.service || echo "Warning: Failed to enable nvidia-cdi-refresh.service" > &2
6360fi
6461
6562%posttrans
You can’t perform that action at this time.
0 commit comments