Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get process parent #11

Closed
giampaolo opened this issue May 23, 2014 · 12 comments
Closed

Get process parent #11

giampaolo opened this issue May 23, 2014 · 12 comments

Comments

@giampaolo
Copy link
Owner

From [email protected] on February 16, 2009 23:02:35

As a new feature, it would be nice to get the process parent as a psutil class.

Example:

>>> parent = psutil.parent(os.getpid())
>>> parent.pid
11038
>>> parentPID = psutil.Process(11038).parent.pid
>>> parentPID
1

Thank you.

Original issue: http://code.google.com/p/psutil/issues/detail?id=11

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From [email protected] on February 16, 2009 14:06:01

I should clarify that this issue is not a defect, as automatically classified by
Google, but I didn't know how to post an "enhancement".

@giampaolo
Copy link
Owner Author

From [email protected] on February 16, 2009 14:23:46

I think that a more convenient API would be:

>>> parent = psutil.Process(11038).parent  # the parent pid
>>> parent
1

...so that if you want to do something useful with the parent process you just
instantiate a new Process class:

>>> psutil.Process(parent)
<psutil.Process object at 0x00A87F70>


I'm gonna add this task in the roadmap.

Labels: -Type-Defect Type-Enhancement Component-Library

@giampaolo
Copy link
Owner Author

From [email protected] on February 16, 2009 17:22:53

Implemented for Linux and OS X as r103 - Windows platform to follow after I've 
chance to research how to implement it and do some testing. For now Windows will
always return None for ppid.

Status: Started

@giampaolo
Copy link
Owner Author

From [email protected] on February 16, 2009 17:24:31

Note: implemented as a "ppid" property currently, rather than "parent", to fit 
the traditional ps command's abbreviation.

@giampaolo
Copy link
Owner Author

From [email protected] on February 16, 2009 18:38:39

Now implemented on Win32 also as r105

Status: Verified
Owner: jloden

@giampaolo
Copy link
Owner Author

From [email protected] on February 17, 2009 08:34:57

After some additional discussion, r109 now implements a "parent" property that
returns a Process object for the parent process.

@giampaolo
Copy link
Owner Author

From [email protected] on February 18, 2009 06:43:23

Labels: Milestone-0.1.1

@giampaolo
Copy link
Owner Author

From [email protected] on February 18, 2009 07:10:56

Well, guys, thanks for the quick response. It's really a pleasure to give 
a group so commited as yours.
I'm now giving my firsts steps to upload my own Python projects into Google 

@giampaolo
Copy link
Owner Author

From [email protected] on February 18, 2009 07:33:39

You're more than welcome, after all we created the library to be used so it's 
to see feedback. Congratulations on being our first user to request an 

@giampaolo
Copy link
Owner Author

From [email protected] on February 23, 2009 09:49:02

Labels: -Component-Library

@giampaolo
Copy link
Owner Author

From [email protected] on March 17, 2009 08:31:19

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:39:33

Updated csets after the SVN -> Mercurial migration: r103 == revision 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant