If systemd is supporting sd_notify protocol, this function will add support for sd_notify protocol from within the container.
(spec *specs.Spec)
| 49 | // If systemd is supporting sd_notify protocol, this function will add support |
| 50 | // for sd_notify protocol from within the container. |
| 51 | func (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 | |
| 62 | func (s *notifySocket) bindSocket() error { |
| 63 | addr := net.UnixAddr{ |