MCPcopy
hub / github.com/containers/toolbox / getDBusSystemSocket

Function getDBusSystemSocket

src/cmd/create.go:531–554  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

529}
530
531func getDBusSystemSocket() (string, error) {
532 logrus.Debug("Resolving path to the D-Bus system socket")
533
534 address := os.Getenv("DBUS_SYSTEM_BUS_ADDRESS")
535 if address == "" {
536 address = "unix:path=/var/run/dbus/system_bus_socket"
537 }
538
539 addressSplit := strings.Split(address, "=")
540 if len(addressSplit) != 2 {
541 return "", errors.New("failed to get the path to the D-Bus system socket")
542 }
543
544 path := addressSplit[1]
545 pathEvaled, err := filepath.EvalSymlinks(path)
546 if err != nil {
547 logrus.Debugf("Resolving path to the D-Bus system socket: failed to evaluate symbolic links in %s: %s",
548 path,
549 err)
550 return "", errors.New("failed to resolve the path to the D-Bus system socket")
551 }
552
553 return pathEvaled, nil
554}
555
556func getEnterCommand(container string) string {
557 var enterCommand string

Callers 1

createContainerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…