From 495cdf501d6f483a4c06fd62501dc7b7268ada9f Mon Sep 17 00:00:00 2001 From: Junichi Satoh Date: Sun, 20 Dec 2015 12:29:23 +0900 Subject: [PATCH] Fixed that a zombie process is created after udp server executes a command. --- pandora_agents/unix/pandora_agent | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 57842fccfb..204d0041ce 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1912,10 +1912,7 @@ sub udp_server ($$) { $process_name =~ s/\s*$//g; if (defined($Conf{"process_${process_name}_start"})) { log_message ('udp server', "Process $process_name started from $hishost"); - if (fork() == 0) { - `$Conf{"process_${process_name}_start"} 2>$DevNull`; - exit 0; - } + system "$Conf{\"process_${process_name}_start\"} 2>$DevNull &"; } else { log_message ('udp server', "Attempt to start unknown process $process_name from $hishost"); } @@ -1926,10 +1923,7 @@ sub udp_server ($$) { $process_name =~ s/\s*$//g; if (defined($Conf{"process_${process_name}_stop"})) { log_message ('udp server', "Process $process_name stopped from $hishost"); - if (fork() == 0) { - `$Conf{"process_${process_name}_stop"} 2>$DevNull`; - exit 0; - } + system "$Conf{\"process_${process_name}_stop\"} 2>$DevNull &"; } else { log_message ('udp server', "Attempt to stop unknown process $process_name from $hishost"); }