This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pid confusion and pstree


On Thu, 4 Aug 2005, Jason Pyeron wrote:

> On Thu, 4 Aug 2005, Igor Pechtchanski wrote:
>
> > On Thu, 4 Aug 2005, Jason Pyeron wrote:
> >
> > > sorry if this wraps.
> > >
> > > what is my WINPID for the current bash?
> > >
> > > [jpyeron@mrlaptop mysql-4.1.13.new]$ ps -W | head -1 && ps -W | grep bash && pstree -Ahup
> > >       PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
> > > I    2356       1    2356       2356  con 1003   Jul 31 /usr/bin/bash
> > >       260       0       0        260    ?    0   Aug  3 C:\cygwin\bin\bash.exe
> > >       484       0       0        484    ?    0   Aug  3 C:\cygwin\bin\bash.exe
> > >      3004       0       0       3004    ?    0   Aug  3 C:\cygwin\bin\bash.exe
> > >       456       0       0        456    ?    0   Aug  3 C:\cygwin\bin\bash.exe
> > >
> > > ?(1)-+-bash(2356,jpyeron)
> > >      |-bash(1516,mkruger)---mysql(476)
> > >      `-cygrunsrv(3616,SYSTEM)---sshd(2956)-+-sshd(2852)---bash(2544,jpyeron)---mysql(236)
> > >                                            |-sshd(3884)---bash(928,jpyeron)
> > >                                            `-sshd(228)---bash(1592,jpyeron)-+-pico(2872)
> > >                                                                             `-pstree(2348)
> > >
> > > [jpyeron@mrlaptop mysql-4.1.13.new]$ echo $$
> > > 1592
> >
> > "ps -W" may not be aware of the Cygwin PID for some processes.
> > How about "/bin/ps | head -1 && /bin/ps -a | grep $$" instead?
>
> Windows taskmanager shows 456, which I found to be the correct pid for
> bash(1592) / echo $$
>
> there was no taskmanager pid 1592 either

Yes, the Cygwin PID and the WINPID are different in most cases.  Doesn't
the command I suggested show the right WINPID for the current bash?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]