Reason for SIGPIPE

I have an application running on Linux, catching signals and sending them to syslog.

This application often reports SIGPIPE events for no apparent reason.

The application runs in the background as a daemon. Signals appear in standby mode with no visible network / sockets. The application often reads and writes to disk and DVB-cards (via DVB kernel drivers).

I would like to know the reason for SIGPIPE. Any means of tracking the source of the signal?

Edit: I added this to the code:

stdin = freopen("/dev/null", "r", stdin); stdout = freopen("/tmp/vdr_stdout", "w", stdout); stderr = freopen("/tmp/vdr_stderr", "w", stderr); 

Still get SIGPIPE.

+4
source share
2 answers

On POSIX-compatible platforms, SIGPIPE is the signal sent to a process when it tries to write to a pipe without a process connected to the other end.

Since you are referencing the daemon context, it is possible that STD * is closed and an attempt to read / write to them is being made .... can there be a printf debug / progress report?

+4
source

Does your daemon close entry and exit ?:

 fclose (stdin); fclose (stdout); fclose (stderr); 
+1
source

All Articles