MCPcopy
hub / github.com/opencontainers/runc / setupSpec

Method setupSpec

notify_socket.go:51–60  ·  view source on GitHub ↗

If systemd is supporting sd_notify protocol, this function will add support for sd_notify protocol from within the container.

(spec *specs.Spec)

Source from the content-addressed store, hash-verified

49// If systemd is supporting sd_notify protocol, this function will add support
50// for sd_notify protocol from within the container.
51func (s *notifySocket) setupSpec(spec *specs.Spec) {
52 pathInContainer := filepath.Join("/run/notify", path.Base(s.socketPath))
53 mount := specs.Mount{
54 Destination: path.Dir(pathInContainer),
55 Source: path.Dir(s.socketPath),
56 Options: []string{"bind", "nosuid", "noexec", "nodev", "ro"},
57 }
58 spec.Mounts = append(spec.Mounts, mount)
59 spec.Process.Env = append(spec.Process.Env, "NOTIFY_SOCKET="+pathInContainer)
60}
61
62func (s *notifySocket) bindSocket() error {
63 addr := net.UnixAddr{

Callers 1

startContainerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected