Commit Graph

3 Commits

Author SHA1 Message Date
Shengjing Zhu
f0d5dd3c82 Use unix.SignalNum in ParseSignal on unix platform
This removes the signalMap on unix platform, since
the signalMap on different architectures is not same,
especially it's wrong on mipsx.

golang.org/x/sys/unix now has a SignalNum func to convert
signal name to a number, thus there's no need to keep
this redundant map.

Windows platform still needs to have a signalMap, since
golang.org/x/sys/windows doesn't have corresponding
functions.

Address: #3061

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2019-03-03 22:10:58 +08:00
Samuel Karp
607888ce29 ctr: make kill use stop-signal by default
The OCI image specification includes a `StopSignal` field in the image
configuration, denoting the system call signal to be sent to the
container to exit.  This commit adds a new `WithImageStopSignal` container
option that can be used for storing the `StopSignal` field as a label on
the container.  This commit also adjusts `ctr run` to call
`WithImageStopSignal` and `ctr tasks kill` to send the signal stored in
that label by default.

Signed-off-by: Samuel Karp <skarp@amazon.com>
2018-09-27 15:53:38 -07:00
Samuel Karp
b392a3a8e4 signals: move ParseSignal to containerd package
Signed-off-by: Samuel Karp <skarp@amazon.com>
2018-09-27 15:53:38 -07:00