Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 09:33:59AM -0500, Eric Blake wrote: > On 10/16/19 9:04 AM, Daniel P. Berrangé wrote: > > On Wed, Oct 16, 2019 at 06:50:33AM -0500, Eric Blake wrote: > > > On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: > > > > > > > > > > > The challenge here is that we're in between fork

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Eric Blake
On 10/16/19 9:04 AM, Daniel P. Berrangé wrote: On Wed, Oct 16, 2019 at 06:50:33AM -0500, Eric Blake wrote: On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: The challenge here is that we're in between fork + execve and want signal handlers back to their defaults at time of execve. If we set SIG

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 06:50:33AM -0500, Eric Blake wrote: > On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: > > > > > The challenge here is that we're in between fork + execve and want signal > > handlers back to their defaults at time of execve. > > > > If we set SIGPIPE to SIG_IGN and then ex

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Eric Blake
On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: The challenge here is that we're in between fork + execve and want signal handlers back to their defaults at time of execve. If we set SIGPIPE to SIG_IGN and then execve() will that get reset back to SIG_DFL automatically ? Sadly, no. execve()

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Daniel P . Berrangé
On Tue, Oct 15, 2019 at 09:59:46PM -0500, Eric Blake wrote: > On 10/15/19 9:43 PM, Eric Blake wrote: > > On 10/15/19 9:25 PM, Wang Yechao wrote: > > > Libvirtd has set SIGPIPE to ignored, and virFork resets all signal > > > handlers to the defaults. But child process may write logs to > > > stderr/

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-15 Thread Eric Blake
On 10/15/19 9:43 PM, Eric Blake wrote: On 10/15/19 9:25 PM, Wang Yechao wrote: Libvirtd has set SIGPIPE to ignored, and virFork resets all signal handlers to the defaults. But child process may write logs to stderr/stdout, that may generate SIGPIPE if journald has stopped. So block SIGPIPE in v

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-15 Thread Eric Blake
On 10/15/19 9:25 PM, Wang Yechao wrote: Libvirtd has set SIGPIPE to ignored, and virFork resets all signal handlers to the defaults. But child process may write logs to stderr/stdout, that may generate SIGPIPE if journald has stopped. So block SIGPIPE in virFork, and unblock it before execve.

[libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-15 Thread Wang Yechao
Libvirtd has set SIGPIPE to ignored, and virFork resets all signal handlers to the defaults. But child process may write logs to stderr/stdout, that may generate SIGPIPE if journald has stopped. So block SIGPIPE in virFork, and unblock it before execve. Signed-off-by: Wang Yechao --- v1 patch: h