systemd uses SIGRTMIN+n signals, but containerd didn't support the signals
since Go's sys/unix doesn't support them.
This change introduces SIGRTMIN+n handling by utilizing moby/sys/signal.
Fixes#5402.
https://www.freedesktop.org/software/systemd/man/systemd.html#Signals
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
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>
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>