Add activation script to clean up old NFS automount unit

This commit is contained in:
UGA Innovation Factory
2025-12-18 21:18:20 -05:00
parent a50e8938df
commit 762be05aa7

View File

@@ -256,6 +256,16 @@ in
# Enable NFS client support
services.rpcbind.enable = true;
# Clean up old automount unit during activation
system.activationScripts.cleanupOldNfsAutomount = ''
if systemctl is-active mnt-nfs_share.automount &>/dev/null; then
systemctl stop mnt-nfs_share.automount || true
fi
if systemctl is-active mnt-nfs_share.mount &>/dev/null; then
systemctl stop mnt-nfs_share.mount || true
fi
'';
# NFS mount for shared storage
fileSystems."/mnt/nfs_share" = {
device = "192.168.1.249:/mnt/nfs_share";