echo will not be seen during shutdown (where would it echo to?). Like I said, I tried it by sending the signal myself using kill, and that works. It's only during reboot that it doesn't work.
I'm actually looking into the possibility that I realized only after I posted: I am running the program in a console and then typing reboot from another console. So won't my program get killed when the console is killed, before being killed by shutdown? If so, what signal does it get? - Gotta look into that, but now I just got pulled away on something else.
Re: 'clean-later' marks: I thought it is best to do as little as possible inside a signal-handler because of problems with re-entrant system calls - that's why I set the global and do the clean-up work later. Am I wrong in this?
--In reply to Re: Re: (slightly OT) catching SIGTERM when system goes down
by edan
in thread (slightly OT) catching SIGTERM when system goes down
by edan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |