maintenance(titan-24): avoid unnecessary Docker restarts
This commit is contained in:
parent
f1a72d64fd
commit
a19a19fbd5
@ -24,6 +24,7 @@ install_docker() {
|
||||
|
||||
configure_docker() {
|
||||
mkdir -p /host/etc/docker
|
||||
local needs_restart=0
|
||||
if [ ! -f /host/etc/docker/daemon.json ]; then
|
||||
cat >/host/etc/docker/daemon.json <<'JSON'
|
||||
{
|
||||
@ -34,13 +35,20 @@ configure_docker() {
|
||||
}
|
||||
}
|
||||
JSON
|
||||
needs_restart=1
|
||||
fi
|
||||
if [ -x /host/usr/bin/nvidia-ctk ]; then
|
||||
if [ -x /host/usr/bin/nvidia-ctk ] && ! grep -q '"nvidia"' /host/etc/docker/daemon.json; then
|
||||
host_sh "nvidia-ctk runtime configure --runtime=docker"
|
||||
needs_restart=1
|
||||
fi
|
||||
host_systemctl daemon-reload
|
||||
host_systemctl enable --now docker
|
||||
host_systemctl restart docker
|
||||
host_systemctl enable docker
|
||||
host_systemctl reset-failed docker || true
|
||||
if [ "${needs_restart}" -eq 1 ]; then
|
||||
host_systemctl restart docker
|
||||
else
|
||||
host_systemctl start docker || true
|
||||
fi
|
||||
}
|
||||
|
||||
configure_nvidia_modeset() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user