[systemd-devel] [PATCH] gssd: Improve scalability by not waiting for child processes

Steve Dickson SteveD at redhat.com
Mon Oct 5 04:50:21 PDT 2015



On 10/04/2015 04:19 AM, Florian Weimer wrote:
> * Steve Dickson:
> 
>> +static void
>> +sig_child(int signal)
>> +{
>> +	int err;
>> +	pid_t pid;
>> +
>> +	/* Parent: just wait on child to exit and return */
>> +	do {
>> +		pid = wait(&err);
>> +	} while(pid == -1 && errno != -ECHILD);
>> +
>> +	if (WIFSIGNALED(err))
>> +		printerr(0, "WARNING: forked child was killed"
>> +			 "with signal %d\n", WTERMSIG(err));
>> +}
> 
> prinerr calls vfprintf or vsyslog.  Neither is safe to use in signal
> handlers, so you need to log this message in some other way.
Good point... but this patch was self NAK-ed due to it leaving
zombie processes during my testing.

steved.



More information about the systemd-devel mailing list