delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS |
X-Spam-Check-By: | sourceware.org |
MIME-Version: | 1.0 |
In-Reply-To: | <5b0039af1001041238y25c0eaa2g1fbe135fdfe62a60@mail.gmail.com> |
References: | <5b0039af1001041238y25c0eaa2g1fbe135fdfe62a60 AT mail DOT gmail DOT com> |
Date: | Mon, 4 Jan 2010 14:10:19 -0800 |
Message-ID: | <5b0039af1001041410r28fcc185s7ab8ff45f988cfbc@mail.gmail.com> |
Subject: | Re: procps returns parent's cmdline for a child process in cygwin 1.7.1 |
From: | Jonathan Schedler <jfschedler AT gmail DOT com> |
To: | cygwin AT cygwin DOT com |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
The following foo.sh script reproduces what I am seeing, using notepad.exe instead of java.exe #!/bin/bash notepad & procps -eF If the above is in a file named foo.sh, the output of procps -eF will be Jon 5072 4756 0 1390 7548 0 14:08 tty0 00:00:00 /usr/bin/bash ./foo.sh Jon 6012 5072 0 407 8576 0 14:08 tty0 00:00:00 /usr/bin/bash ./foo.sh Jon 5716 5072 0 1185 6012 0 14:08 tty0 00:00:00 procps -eF Notice the procps command shows up correctly. So it seems I have an issue displaying normal windows exe's in procps output. Jon On Mon, Jan 4, 2010 at 12:38 PM, Jonathan Schedler <jfschedler AT gmail DOT com> w= rote: > I have updated to cygwin 1.7.1 from 1.5.x this morning. =A0I have > discovered that some of my scripts have started to fail. > > I am on Vista SP2. > > uname -a is returns: > CYGWIN_NT-6.0-WOW64 Office-PC 1.7.1(0.218/5/3) 2009-12-07 11:48 i686 Cygw= in > > My script starts a process in the background and then kills it later > by searching the output of procps for the pid of the background > process. =A0After I upgraded to cygwin 1.7.1 this morning, I noticed > that procps was returning two pids instead of one. > > I then examined the /proc filesystem and found the following results > below. =A0It shows that process 2940 is a child process of 6004 and that > process 2940's cmdline is identical to its parent process command > line. =A0This is unexpected. =A0The command line for 2940 (in my case) > should actually be a typical java command containing a -cp arg and a > java class name. > > Note that /proc/2940/exename does indeed contain a reference to my > java.exe. =A0Also note that the /proc/2940/exe symlink points to the > java.exe as well. > > # cat /proc/6004/cmdline > /usr/bin/bash /cygdrive/c/dev/voldemort-0.60/bin/voldemort-server.sh > ../ce-contacts-model/target/classes/store/ > > # cat /proc/6004/exename > /usr/bin/bash > > # cat /proc/2940/ppid > 6004 > > # cat /proc/2940/cmdline > /usr/bin/bash /cygdrive/c/dev/voldemort-0.60/bin/voldemort-server.sh > ../ce-contacts-model/target/classes/store/ > > # cat /proc/2940/exename > /cygdrive/c/sun/SDK/jdk/bin/java > > # ls -l /proc/2940/exe > lrwxrwxrwx 1 Jon None 0 2006-11-30 16:00 /proc/2940/exe -> > /cygdrive/c/sun/SDK/jdk/bin/java* > > It appears that procps is behaving correctly and is reading the > incorrect contents of /proc/{pid}/cmdline for a child process (i.e. it > containing its parents command line rather than its own). > > Furthermore, it doesn't appear there is a CYGWIN env var setting that > affects what is stored in /proc/{pid}/cmdline. =A0So, I think I am > stuck. > > Jon > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |