mirror of
https://github.com/containers/podman.git
synced 2025-06-02 02:26:52 +08:00
Change stop signal default to SIGTERM
Signed-off-by: Matthew Heon <mheon@redhat.com> Closes: #299 Approved by: rhatdan
This commit is contained in:
@ -527,7 +527,7 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime, imageName string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// STOP SIGNAL
|
// STOP SIGNAL
|
||||||
stopSignal := syscall.SIGINT
|
stopSignal := syscall.SIGTERM
|
||||||
signalString := data.Config.StopSignal
|
signalString := data.Config.StopSignal
|
||||||
if c.IsSet("stop-signal") {
|
if c.IsSet("stop-signal") {
|
||||||
signalString = c.String("stop-signal")
|
signalString = c.String("stop-signal")
|
||||||
|
@ -394,6 +394,7 @@ func (r *OCIRuntime) startContainer(ctr *Container) error {
|
|||||||
|
|
||||||
// killContainer sends the given signal to the given container
|
// killContainer sends the given signal to the given container
|
||||||
func (r *OCIRuntime) killContainer(ctr *Container, signal uint) error {
|
func (r *OCIRuntime) killContainer(ctr *Container, signal uint) error {
|
||||||
|
logrus.Debugf("Sending signal %d to container %s", signal, ctr.ID())
|
||||||
if err := utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, r.path, "kill", ctr.ID(), fmt.Sprintf("%d", signal)); err != nil {
|
if err := utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, r.path, "kill", ctr.ID(), fmt.Sprintf("%d", signal)); err != nil {
|
||||||
return errors.Wrapf(err, "error sending signal to container %s", ctr.ID())
|
return errors.Wrapf(err, "error sending signal to container %s", ctr.ID())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user