Skip to content

Tag: signals

Why is SIGFPE not triggered after adding a printf line?

I am playing with a simple program (source code below). And my computer configuration: Linux mymachine 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) I intend to trigger the SIGFPE in this program by calling the ex…

SigCgt value is not getting updated in /proc//status file?

I have read about the signal handling in linux processes. I am using centOS 7.1 (kernel 3.10+). I am registering handler only for SIGTERM in my c++ program. As per my knowledge(not sure if my assumptions are correct). We can check all the signals a process is listening to in /proc/$pid/status file by using Si…

Send signal to other process

since os/signal is only for handling of incoming signals I’m asking if there is a native way to send signals to other processes? Edit: The process I want to mange is nginx. My Go application should listen for some events and then send a SIGHUP to nginx to reload its configuration Answer If you have crea…

How to register a signal handler for a subprocess?

Adding a signal handler, e.g. with process.sh doesn’t work because CtrlC interrupts the child process (only SIGINT received is printed), but both SIGINT received and SIGINT child received should be printed and the child continue to run. Adding signal.SIG_IGN leaves the child untouched, but that not suff…

Safe global state for signal handling

I am toying around with Rust and various UNIX libraries. A use-case that I have right now is that I want to react to POSIX signals. To keep things reasonable I want to create an abstraction over the signal handling so that the rest of my program doesn’t have to worry about them as much. Let’s call…