[sheepdog] [PATCH] logger: detect death of its parent process in a correct manner

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Oct 20 03:24:04 CEST 2014


At Fri, 17 Oct 2014 16:26:41 +0900,
Hitoshi Mitake wrote:
> 
> init process doesn't always be a parent of logger process. It depends
> on execution environment. This patch implements a correct way of
> detecting death of sheep process in logger process.
> 
> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> ---
>  lib/logger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied.

Thanks,
Hitoshi

> 
> diff --git a/lib/logger.c b/lib/logger.c
> index 3b77543..02bab00 100644
> --- a/lib/logger.c
> +++ b/lib/logger.c
> @@ -618,7 +618,7 @@ static void logger(char *log_dir, char *outfile)
>  
>  		unblock_sighup();
>  
> -		if (getppid() == 1)
> +		if (getppid() != sheep_pid)
>  			/* My parent (sheep process) is dead. */
>  			break;
>  
> -- 
> 1.8.3.2
> 



More information about the sheepdog mailing list