diff --git a/notify_socket.go b/notify_socket.go index 00ca672d3..76aa27ca5 100644 --- a/notify_socket.go +++ b/notify_socket.go @@ -43,7 +43,7 @@ func (s *notifySocket) Close() error { // If systemd is supporting sd_notify protocol, this function will add support // for sd_notify protocol from within the container. -func (s *notifySocket) setupSpec(context *cli.Context, spec *specs.Spec) error { +func (s *notifySocket) setupSpec(spec *specs.Spec) { pathInContainer := filepath.Join("/run/notify", path.Base(s.socketPath)) mount := specs.Mount{ Destination: path.Dir(pathInContainer), @@ -52,7 +52,6 @@ func (s *notifySocket) setupSpec(context *cli.Context, spec *specs.Spec) error { } spec.Mounts = append(spec.Mounts, mount) spec.Process.Env = append(spec.Process.Env, "NOTIFY_SOCKET="+pathInContainer) - return nil } func (s *notifySocket) bindSocket() error { diff --git a/utils_linux.go b/utils_linux.go index 4f0c192ba..a9badf20f 100644 --- a/utils_linux.go +++ b/utils_linux.go @@ -387,9 +387,7 @@ func startContainer(context *cli.Context, action CtAct, criuOpts *libcontainer.C notifySocket := newNotifySocket(context, os.Getenv("NOTIFY_SOCKET"), id) if notifySocket != nil { - if err := notifySocket.setupSpec(context, spec); err != nil { - return -1, err - } + notifySocket.setupSpec(spec) } container, err := createContainer(context, id, spec)