-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os/signal: Unable to catch SIGHUP signal multiple times #11700
Comments
It's sort of peculiar that each time through the loop you are creating and registering a new channel. Is that really what you want to do? Why not create just one channel, before the loop? |
@ianlancetaylor I tried many ways but they all have the same result; the code above is my last latest try. |
I can't recreate the problem. I ran this: http://play.golang.org/p/7FAc7wzuhK . In a separate terminal window, I typed "kill -SIGHUP PID". Each time I ran that command, the program printed SIGHUP. Please show us a complete program. |
@ianlancetaylor |
It's working now. I probably tried to compile and didn't pay attention if the binary got updated (prob had syntax error somewhere with autobuild). |
I have the following code:
I "register" the signal like so:
The problem that I'm experiencing is that I'm only able to catch one SIGHUP. For example if I send multiple
kill -SIGHUP <pid>
to the process, the "register" code only runs once. How can I get it to run every time the signal is sent?I also posted this here: http://stackoverflow.com/questions/31395761/handle-signal-multiple-times-in-golang
The text was updated successfully, but these errors were encountered: