#!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. set -e case "$1" in install|upgrade) # Create needrestart config BEFORE package installation to prevent service restart # This is critical for the first deployment of this fix if [ ! -d /etc/needrestart/conf.d ]; then mkdir -p /etc/needrestart/conf.d fi # Create the config to prevent our services from restarting cat > /etc/needrestart/conf.d/50-dgx-dashboard.conf << 'EOF' # Exclude dgx-dashboard services from automatic restart # This prevents service disruption during self-updates # Override service restart for our specific services # 0 = don't restart $nrconf{override_rc}{qr(^dgx-dashboard\.service$)} = 0; $nrconf{override_rc}{qr(^dgx-dashboard-admin\.service$)} = 0; EOF chmod 644 /etc/needrestart/conf.d/50-dgx-dashboard.conf chown root:root /etc/needrestart/conf.d/50-dgx-dashboard.conf echo "dgx-dashboard: needrestart config installed to prevent service restart during upgrade" ;; esac #DEBHELPER# exit 0