mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Merge 99aeed95c7
into 178348b782
This commit is contained in:
commit
97adac144c
@ -6,14 +6,13 @@ case "$1" in
|
|||||||
configure)
|
configure)
|
||||||
/usr/bin/nvidia-ctk --quiet config --config-file=/etc/nvidia-container-runtime/config.toml --in-place
|
/usr/bin/nvidia-ctk --quiet config --config-file=/etc/nvidia-container-runtime/config.toml --in-place
|
||||||
|
|
||||||
|
# Enable nvidia-cdi-refresh services on both install and upgrade
|
||||||
if command -v systemctl >/dev/null 2>&1 \
|
if command -v systemctl >/dev/null 2>&1 \
|
||||||
&& systemctl --quiet is-system-running 2>/dev/null; then
|
&& systemctl --quiet is-system-running 2>/dev/null; then
|
||||||
|
|
||||||
systemctl daemon-reload || true
|
systemctl daemon-reload || { echo "Warning: Failed to reload systemd daemon" >&2; true; }
|
||||||
|
systemctl enable --now nvidia-cdi-refresh.path || { echo "Warning: Failed to enable nvidia-cdi-refresh.path" >&2; true; }
|
||||||
if [ -z "$2" ]; then # $2 empty → first install
|
systemctl enable --now nvidia-cdi-refresh.service || { echo "Warning: Failed to enable nvidia-cdi-refresh.service" >&2; true; }
|
||||||
systemctl enable --now nvidia-cdi-refresh.path || true
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -51,15 +51,12 @@ if [ $1 -gt 1 ]; then # only on package upgrade
|
|||||||
cp -af %{_bindir}/nvidia-container-runtime-hook %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit
|
cp -af %{_bindir}/nvidia-container-runtime-hook %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reload systemd unit cache
|
# Reload systemd unit cache and enable nvidia-cdi-refresh services on both install and upgrade
|
||||||
if command -v systemctl >/dev/null 2>&1 \
|
if command -v systemctl >/dev/null 2>&1 \
|
||||||
&& systemctl --quiet is-system-running 2>/dev/null; then
|
&& systemctl --quiet is-system-running 2>/dev/null; then
|
||||||
systemctl daemon-reload || true
|
systemctl daemon-reload || { echo "Warning: Failed to reload systemd daemon" >&2; true; }
|
||||||
|
systemctl enable --now nvidia-cdi-refresh.path || { echo "Warning: Failed to enable nvidia-cdi-refresh.path" >&2; true; }
|
||||||
# On fresh install ($1 == 1) enable the path unit so it starts at boot
|
systemctl enable --now nvidia-cdi-refresh.service || { echo "Warning: Failed to enable nvidia-cdi-refresh.service" >&2; true; }
|
||||||
if [ "$1" -eq 1 ]; then
|
|
||||||
systemctl enable --now nvidia-cdi-refresh.path || true
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%posttrans
|
%posttrans
|
||||||
|
Loading…
Reference in New Issue
Block a user