cmd/podman, pkg/domain/infra: sockets should live in /var/run on FreeBSD

The /var/run directory is the preferred location for unix domain
sockets.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson
2022-11-18 15:17:15 +00:00
parent e3f2a97d1f
commit 43b9426fc6
6 changed files with 20 additions and 4 deletions

View File

@ -12,9 +12,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
// DefaultRootAPIPath is the default path of the REST socket
const DefaultRootAPIPath = "/run/podman/podman.sock"
// DefaultRootAPIAddress is the default address of the REST socket with unix: prefix // DefaultRootAPIAddress is the default address of the REST socket with unix: prefix
const DefaultRootAPIAddress = "unix:" + DefaultRootAPIPath const DefaultRootAPIAddress = "unix:" + DefaultRootAPIPath

View File

@ -0,0 +1,7 @@
//go:build !freebsd
// +build !freebsd
package registry
// DefaultRootAPIPath is the default path of the REST socket
const DefaultRootAPIPath = "/run/podman/podman.sock"

View File

@ -0,0 +1,4 @@
package registry
// DefaultRootAPIPath is the default path of the REST socket
const DefaultRootAPIPath = "/var/run/podman/podman.sock"

View File

@ -35,7 +35,7 @@ func (ic *ContainerEngine) Info(ctx context.Context) (*define.Info, error) {
// we are reporting the default systemd activation socket path as we cannot know if a future // we are reporting the default systemd activation socket path as we cannot know if a future
// service may be run with another URI. // service may be run with another URI.
if ic.Libpod.RemoteURI() == "" { if ic.Libpod.RemoteURI() == "" {
xdg := "/run" xdg := defaultRunPath
if path, err := util.GetRuntimeDir(); err != nil { if path, err := util.GetRuntimeDir(); err != nil {
// Info is as good as we can guess... // Info is as good as we can guess...
return info, err return info, err

View File

@ -0,0 +1,4 @@
package abi
// Default path for system runtime state
const defaultRunPath = "/var/run"

View File

@ -0,0 +1,4 @@
package abi
// Default path for system runtime state
const defaultRunPath = "/run"