Skip to content

Signal can't be caught by the underlying binary #269

@alon7

Description

@alon7

Hi everyone

Moved my code from makefile to mage and I'm very pleased so thank you for the great work!

I'm running another go binary which has a loop running and this code to catch signals

stopChan := make(chan os.Signal)
	signal.Notify(stopChan, syscall.SIGTERM, syscall.SIGINT, os.Interrupt, syscall.SIGQUIT, syscall.SIGHUP)

then this code a bit later:

<-stopChan
log.Info("Shutting down gracefully...")

but when i ctrl + c my mage running process the underlying process doesn't receive any signal.
I've seen it with other executables that do cleanup on terminal as well such as terraform.

Let me know if you have any idea on how to approach a fix here or maybe if I'm missing something.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions