instance.Start runs the host-agent as a subprocess using limactl. This code currently only works when it is invoked by limactl itself. Adding a parameter to allow a caller to pass in the path to the limactl binary to use.
The tail.Cleanup function prevents the process from tailing the same file again (at least on macOS), which breaks instance.Stop because it can no longer receive the exited event by tailing ha.stdout.log.
If you plan to re-read a file, don't call Cleanup in between.
Eventually I would like to be able to (optionally) also run the host-agent in-process and not rely on tailing a log file for IPC, but that is a bigger change for another time.
PS: I think in this case the 2 commits shouldn't be squashed, as they have a common purpose, but address separate issues. It just feels like overkill to create a separate PR just to remove the 2 Cleanup calls.
instance.Start
runs the host-agent as a subprocess usinglimactl
. This code currently only works when it is invoked bylimactl
itself. Adding a parameter to allow a caller to pass in the path to thelimactl
binary to use.The
tail.Cleanup
function prevents the process from tailing the same file again (at least on macOS), which breaksinstance.Stop
because it can no longer receive theexited
event by tailingha.stdout.log
.A hint has been added to the module docs (without further context or explanation) in https://github.com/nxadm/tail/commit/2efc79c:
Eventually I would like to be able to (optionally) also run the host-agent in-process and not rely on tailing a log file for IPC, but that is a bigger change for another time.
PS: I think in this case the 2 commits shouldn't be squashed, as they have a common purpose, but address separate issues. It just feels like overkill to create a separate PR just to remove the 2
Cleanup
calls.