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

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Oct 17 09:26:41 CEST 2014


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(-)

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