From efd0461813ff93171926fdc3c72e6ee8d4f4bd1e Mon Sep 17 00:00:00 2001 From: crowetic Date: Wed, 16 Apr 2025 21:04:50 +0000 Subject: [PATCH] actually fixed creation of service file --- vm-tool-setup.sh | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/vm-tool-setup.sh b/vm-tool-setup.sh index 9d274f0..0b3ef82 100755 --- a/vm-tool-setup.sh +++ b/vm-tool-setup.sh @@ -32,31 +32,24 @@ echo "VM NICs detected: ${NIC_LIST[*]}" echo "=== [5/5] Creating persistent systemd service to disable offloads ===" SERVICE_FILE="/etc/systemd/system/disable-vm-nic-offloads.service" -DISABLE_CMDS="" -for nic in "${NIC_LIST[@]}"; do - DISABLE_CMDS+="/usr/sbin/ethtool -K $nic tx off rx off tso off gso off gro off; " - DISABLE_CMDS+="/sbin/ip link set $nic txqueuelen 10000; " -done - -# Escape for ExecStart -DISABLE_CMDS_ESCAPED=$(printf '%q ' "$DISABLE_CMDS") - -sudo tee "$SERVICE_FILE" > /dev/null < /dev/null echo "=== Enabling and starting NIC offload disable service ===" -sudo systemctl daemon-reexec sudo systemctl daemon-reload sudo systemctl enable --now disable-vm-nic-offloads.service