From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtMeN-0006eK-3V for qemu-devel@nongnu.org; Fri, 03 Feb 2012 12:10:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtMeD-00075i-Fp for qemu-devel@nongnu.org; Fri, 03 Feb 2012 12:10:15 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:52987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtMeD-00073t-88 for qemu-devel@nongnu.org; Fri, 03 Feb 2012 12:10:05 -0500 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Feb 2012 12:10:03 -0500 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 309656E81AC for ; Fri, 3 Feb 2012 12:09:10 -0500 (EST) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q13H8wq83473554 for ; Fri, 3 Feb 2012 12:09:00 -0500 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q13H7gW6016393 for ; Fri, 3 Feb 2012 10:07:42 -0700 Message-ID: <4F2C145A.3050002@linux.vnet.ibm.com> Date: Fri, 03 Feb 2012 11:07:38 -0600 From: Michael Roth MIME-Version: 1.0 References: <4F2B61CE.7040701@intellilink.co.jp> In-Reply-To: <4F2B61CE.7040701@intellilink.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/8] qemu-ga: move channel/transport functionalit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "MATSUDA, Daiki" Cc: qemu-devel@nongnu.org On 02/02/2012 10:25 PM, MATSUDA, Daiki wrote: > Hi, Michael! > Thank you for your working. > > And I have a question the process id written in pid file. > If qemu-ga is ran as daemon, the parent process id not child is written > in pid file. So, id gotten by 'ps' command is different. Is it correct > work? Many other daemon writes child process id. > > Regards > MATSUDA Daiki > Hi Matsuda, Thank you for testing! In the become_daemon() function, the parent exits immediately after the fork(), so only the child has the opportunity to write to the pid file. It calls getpid() to get the pid to write, which should be it's own lwpid. So I'm not seeing where there's an opportunity for the parent pid to be written. Can you confirm? It seems to behave as expected for me: [root@vm ~]# /home/mdroth/w/qemu-build/qemu-ga -d ** (process:7441): DEBUG: starting daemon [root@vm ~]# ps aux | grep qemu-ga root 7442 0.0 0.0 13792 348 ? Ss 10:56 0:00 /home/mdroth/w/qemu-build/qemu-ga -d root 7471 0.0 0.1 109108 816 pts/2 R+ 11:00 0:00 grep --color=auto qemu-ga [root@vm ~]# cat /var/run/qemu-ga.pid 7442