diff --git a/routlin/install.py b/routlin/install.py index 105abb8..c9780cc 100644 --- a/routlin/install.py +++ b/routlin/install.py @@ -192,6 +192,7 @@ def install_core_packages(pm): if not missing: print(" All required packages are already installed.") + fix_freeradius_service_file() return print(" The following packages are not installed:") @@ -210,6 +211,19 @@ def install_core_packages(pm): die("Package installation failed. Install manually and retry.") print("\n Core packages installed.") + fix_freeradius_service_file() + + +def fix_freeradius_service_file(): + svc = Path("/lib/systemd/system/freeradius.service") + if not svc.exists(): + return + text = svc.read_text() + if "MemoryLimit=" not in text: + return + svc.write_text(text.replace("MemoryLimit=", "MemoryMax=")) + subprocess.run(["systemctl", "daemon-reload"], capture_output=True, text=True) + print(" Fixed deprecated MemoryLimit= in freeradius.service (replaced with MemoryMax=).") # ===================================================================