Skip to content

Commit 9d7f541

Browse files
committed
Stop hardcoding /run as the runtime path
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 2748225 commit 9d7f541

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

cmd/lima-guestagent/daemon_freebsd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ func newDaemonCommand() *cobra.Command {
2828

2929
func daemonAction(cmd *cobra.Command, _ []string) error {
3030
socket := "/run/lima-guestagent.sock"
31+
{ // runtime.GOOS == "freebsd"
32+
socket = "/var" + socket
33+
}
3134
tick, err := cmd.Flags().GetDuration("tick")
3235
if err != nil {
3336
return err

pkg/hostagent/hostagent.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ func (a *HostAgent) watchGuestAgentEvents(ctx context.Context) {
539539

540540
localUnix := filepath.Join(a.instDir, filenames.GuestAgentSock)
541541
remoteUnix := "/run/lima-guestagent.sock"
542+
if *a.y.OS == limayaml.FREEBSD {
543+
remoteUnix = "/var" + remoteUnix
544+
}
542545

543546
a.onClose = append(a.onClose, func() error {
544547
logrus.Debugf("Stop forwarding unix sockets")

pkg/hostagent/requirements.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,15 @@ A possible workaround is to run "lima-guestagent install-systemd" in the guest.
134134
`,
135135
})
136136
} else {
137+
run := "/run"
138+
if *a.y.OS == limayaml.FREEBSD {
139+
run = "/var" + run
140+
}
137141
req = append(req, requirement{
138142
description: "the guest agent to be running",
139143
script: `#!/bin/bash
140144
set -eux -o pipefail
141-
sock="/run/lima-guestagent.sock"
145+
sock="` + run + `/lima-guestagent.sock"
142146
if ! timeout 30s bash -c "until [ -S \"${sock}\" ]; do sleep 3; done"; then
143147
echo >&2 "lima-guestagent is not installed yet"
144148
exit 1

0 commit comments

Comments
 (0)