From 39166a7d8ec251888f2ce6cceee5351f9afc34bb Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Sat, 14 Sep 2024 03:56:17 +0300 Subject: [PATCH] Keep the launchd daemon alive Working with multiple lima clusters in the recent weeks I found that socket_vmnet is not running for unknown reason. The typical flow is trying to start the clusters, and lima hostagent fails with connection refused with /var/run/socket_vmnet. This happens to me one or more times in the same day. Trying to run a stress test creating and destroying the lima clusters 50 times fails after several runs and from the point of the failure, all runs failed. The issue seems to be that socket_vmnet is stopped by launched because it seems to be idle and it is never started again. Adding the keep alive option eliminated this issue. With this change the daemon is kept running and it should restart after failures. --- launchd/io.github.lima-vm.socket_vmnet.bridged.en0.plist | 2 ++ launchd/io.github.lima-vm.socket_vmnet.plist | 2 ++ 2 files changed, 4 insertions(+) diff --git a/launchd/io.github.lima-vm.socket_vmnet.bridged.en0.plist b/launchd/io.github.lima-vm.socket_vmnet.bridged.en0.plist index c3c27f4..cf93eb1 100644 --- a/launchd/io.github.lima-vm.socket_vmnet.bridged.en0.plist +++ b/launchd/io.github.lima-vm.socket_vmnet.bridged.en0.plist @@ -20,6 +20,8 @@ /var/log/socket_vmnet/bridged.en0.stdout RunAtLoad + KeepAlive + UserName root diff --git a/launchd/io.github.lima-vm.socket_vmnet.plist b/launchd/io.github.lima-vm.socket_vmnet.plist index ca1da11..7f92446 100644 --- a/launchd/io.github.lima-vm.socket_vmnet.plist +++ b/launchd/io.github.lima-vm.socket_vmnet.plist @@ -19,6 +19,8 @@ /var/log/socket_vmnet/stdout RunAtLoad + KeepAlive + UserName root