mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
move notifySocket out of signalHandler
In fact, notifySocket has no relationship to signalHandler, we can move it out of signalHandler to make the code more clear. Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
@@ -151,6 +151,22 @@ func (s *notifySocket) run(pid1 int) error {
|
||||
}
|
||||
}
|
||||
|
||||
// forward reads systemd notifications from the container and forwards them
|
||||
// to notifySocketHost.
|
||||
func (s *notifySocket) forward(process *libcontainer.Process, detach bool) error {
|
||||
if detach {
|
||||
pid, err := process.Pid()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = s.run(pid)
|
||||
} else {
|
||||
_ = s.run(os.Getpid())
|
||||
go func() { _ = s.run(0) }()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// notifyHost tells the host (usually systemd) that the container reported READY.
|
||||
// Also sends MAINPID and BARRIER.
|
||||
func notifyHost(client *net.UnixConn, ready []byte, pid1 int) error {
|
||||
|
||||
Reference in New Issue
Block a user