From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10069 invoked by alias); 19 Mar 2002 17:27:00 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 10026 invoked from network); 19 Mar 2002 17:26:56 -0000 Received: from unknown (HELO mail17.messagelabs.com) (62.231.131.67) by sources.redhat.com with SMTP; 19 Mar 2002 17:26:56 -0000 X-VirusChecked: Checked Received: (qmail 15084 invoked from network); 19 Mar 2002 17:13:04 -0000 Received: from gull.midas-kapiti.com (HELO pigeon.misys.com) (193.115.208.67) by server-8.tower-17.messagelabs.com with SMTP; 19 Mar 2002 17:13:04 -0000 Received: FROM gull.misys.com BY pigeon.misys.com ; Tue Mar 19 17:13:03 2002 0000 Received: from PORCINE ([10.80.55.220]) by gull.misys.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id GK46BJWG; Tue, 19 Mar 2002 17:13:04 -0000 Message-ID: <01ee01c1cf69$2095abc0$dc37500a@midaskapiti.com> From: "Stephen Osborn" To: References: <002301c1c394$f2c00090$dc37500a@midaskapiti.com> <20020304191012.GE14103@redhat.com> <00be01c1c5ec$eafce300$dc37500a@midaskapiti.com> <20020307160816.GF10147@redhat.com> Subject: Re: cygwin 1.3.10: kill gives spurious Not owner Date: Tue, 19 Mar 2002 10:00:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-SW-Source: 2002-03/txt/msg01041.txt.bz2 Christopher, Apologies for not responding sooner - other work things got in the way. You say: > The below ps output indicates that the program is not being started by > bash. You can see that it is using /bin/sh. If you have changed this > and now start the program via bash then it should work. If it doesn't > work, then I really don't know why. When I originally posted the relevant script did have /bin/sh but I spotted & changed this almost immediately and it made no difference. So the relevant script is now: QUOTE #!/bin/bash java -server -classpath "./formattest.jar;$MERIDIAN_CLASSPATH" -Dmeridian.home="$MERIDIAN_HOME" com.misys.meridian.runtime.server.StartServer formattest -logToScreen UNQUOTE However after all processing has stopped (I have suppressed the kill statements) ps yields: PID PPID PGID WINPID TTY UID STIME COMMAND 477 1 477 477 con 1006 15:03:10 /usr/bin/bash 457 1 386 380 con 1006 16:53:05 /usr/bin/sh 337 457 386 337 con 1006 Jan 1 /cygdrive/d/jdk1.3/bin/java 453 386 386 448 con 1006 16:54:36 /usr/bin/ps I have scanned all of my scripts and /bin/sh does not appear in any of them. Any ideas as to how a bash process can appear as a sh process? >From a bash window, I can kill the /bin/sh process (457 above). This does not terminate the java process (337 above) that was spawned from the /bin/sh process. Also, from a bash window if I try to kill the java process I continue to get a Not owner message. regards Stephen ----- Original Message ----- From: Christopher Faylor To: Sent: Thursday, March 07, 2002 4:08 PM Subject: Re: cygwin 1.3.10: kill gives spurious Not owner > On Thu, Mar 07, 2002 at 03:29:48PM -0000, Stephen Osborn wrote: > >> /cygdrive/d/jdk1.3/bin/java is undoubtedly not a cygwin process > >It is a bash script that runs a java program. > >I would expect the bash script to catch and process the signal. > > > >Is this a mistaken assumption? > > > >> The work around is to use bash to start the process. > >This is what I am doing. The script is only two lines long, viz: > > > >#!/bin/bash > > > >java -server -classpath > >"./NewFlatFileAdapter.jar:$MERIDIAN_CLASSPATH" -Dmeridian.home="$MERIDIAN_H O > >ME" com.misys.meridian.runtime.server.StartServer > >ewFlatFileAdapter -logToScreen > > The below ps output indicates that the program is not being started by > bash. You can see that it is using /bin/sh. If you have changed this > and now start the program via bash then it should work. If it doesn't > work, then I really don't know why. > > > cgf > > >----- Original Message ----- > >From: Christopher Faylor > >To: > >Sent: Monday, March 04, 2002 7:10 PM > >Subject: Re: cygwin 1.3.10: kill gives spurious Not owner > > > > > >> On Mon, Mar 04, 2002 at 03:54:52PM -0000, Stephen Osborn wrote: > >> >When using kill I get spurious "Not owner" messages, even though all > >> >processes (reported by ps) are running as me. > >> > > >> >In the mailing list archives the only problems with kill seem to be > >> >related to killing *other* users' processes. This is not what I am > >> >doing. > >> > > >> >I am running Cygwin on NT. Cygcheck o/p at the bottom. > >> > > >> >I have a script (A) which runs another script (B) in a separate > >> >process. B stores its PID and this is retrieved by the A. B also runs > >> >another script (C) in a separate process. > >> > > >> >Script A tries to remove all of these processes in a housekeeping > >> >exercise, by using ps, grep and script B's PID. > >> > > >> >This successfully kills script B but on script C a "Not owner" error is > >> >thrown. > >> > > >> >This was working as expected (i.e. both B & C were killed) but this > >> >changed a couple of days ago. > >> > > >> >I have modified script A to remove the kill command and after the run > >> >ps gives > >> > > >> > PID PPID PGID WINPID TTY UID STIME COMMAND > >> > 802 1 802 802 con 1006 14:11:18 /usr/bin/bash > >> >I 564 1 564 564 con 1006 14:11:40 /usr/bin/bash > >> > 831 1 1020 1034 con 1006 14:38:57 /usr/bin/sh > >> > 920 831 1020 920 con 1006 Jan 1 > >/cygdrive/d/jdk1.3/bin/java > >> > 682 802 682 571 con 1006 14:44:04 /usr/bin/ps > >> > > >> >Issuing kill 920 (=script C) yields > >> >bash: kill: (920) - Not owner > >> > >> /cygdrive/d/jdk1.3/bin/java is undoubtedly not a cygwin process so it > >> doesn't respond to cygwin signals. This is because recent versions of > >> /bin/sh now use vfork()/exec() to start processes. vfork/exec does > >> not leave an cygwin stub around to deal with signals for non-cygwin > >> processes. > >> > >> The work around is to use bash to start the process. > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/