Getting parent pid execname

I am modifying opensnoop to try to determine the script/executable that removes a file. How do I get access to the parent pid "PROCESS NAME". I know how to get the ppid, but what about it's name and args that it used.
For example:
===== blah.sh ========
#!/bin/sh
rm /var/tmp/foobar
=============
In the "opensnoop", I have the function:
syscall::unlink:entry
{ self->pathp = arg0 }
syscall::unlink:return
{ printf("Parent pid <%d>  unlinked the file %s done with %s command.", ppid, basename(copyinstr(self->pathp)), execname }
WHICH WOULD OUTPUT: Parent pid 1234 unlinked the file foobar with rm command.
How do I get the PPID information since I want to know that it was "blah.sh" that was the culprit behind removal of this file?
Thanks,
Sean

Here's a not-terribly-pretty way:
curthread->t_procp->p_parent->->p_user.u_psargs

Similar Messages

  • How do I get the PID of a child process in java using JNI?

    I am writing an app in Java (for **nix) that will spawn multiple processes (using Process objects). I want to be able to get the PID for a particular child process (not the parent). How can I do this?

    You could try an extreme hack of using JNI to read whatever field of the java.lang.Process-derived class may hold a native process id. This would be unsupportable beyond the exact JVM(s) you can test it on, and should only be a last resort, but within these constraints it may work well. The source code for package java.lang gives clues of where to start hacking.
    -slj-

  • Problem with Jtree to xml tranform..how to set/get parent of a node?

    Hi,
    I am trying to develop xml import/export module.In import wizard, I am parsing the xml file and the display it in Jtree view using xml tree model which implements TreeModel and xml tree node.I am using jaxp api..
    It is workin fine.
    I got stuck with removal of selected node and save it as a new xml.
    I am not able to get parent node of selected node in remove process,itz throwing null.I think i missed to define parent when i load treemodel.Plz help me out..give some ideas to do it..
    thanks
    -bala
    Edited by: r_bala on May 9, 2008 4:44 AM

    there's no way anyone can help you without seeing your code.

  • Get Parent node from Base member

    Hi ,
    My user select base member from CV .
    I want parent node for that base member .
    I am using =EVPRO( App name , memmber id , "PARENTH1" ) .
    I am not getting parent member from this funcation .
    Pls let me know any other way for this ?
    regards,
    PSR

    Hi,
    EVPRO for getting the value for PARENTH1 of any member should work. Please check whether you have included all the parameters of this function inside double quotes.
    EVPRO("APPNAME","MEMBER_ID","PROPERTY")
    Hope this helps,
    Regards,
    G.Vijaya Kumar

  • Get parent window in webutil

    Hi,
    I am trying to migrate 6i libraries to 10g in Orcle forms, in one of the pll it is using below procedure.
    In this it is calling wi_api_utility.get_parent_window procedure, which is part of d2kwutil.
    Now I have to use webutil instead of d2kwutil, becuase d2kwutil will not supported for webforms.
    Is there any same procedure avaialble in webutil to replace win_api's get_parent_window?
    If anyone knows solution for this please help me.
    Thanks.
    PROCEDURE Window_On_Top (Window_Name IN WINDOW) is
    hWnd PLS_INTEGER;
    hParent PLS_INTEGER:=1;
    iRC PLS_INTEGER;
    BEGIN
    hWnd := to_number(get_window_property(Window_Name,WINDOW_HANDLE));
    hParent := win_api_utility.get_parent_window(hWnd,TRUE,FALSE);
    IF hParent <> 0 THEN
    hWnd := hParent;
    END IF;
    iRC := i_SetwindowPos(fh_SetWindowPos,hwnd,-1,0,0,0,0,19);
    END;

    Hi,
    Solved.
    If alias name of parent databank always remains same, then you can directly use +"{{db.aliasName.ColumnName}}"+
    Otherwise, to get parent databank alias name use
    ScriptPackage parentScript= utilities.getCurrentVUSer().getParentUser().scriptPackage;
              ArrayList<String> parentDB = parentScript.getDatabankAliases();
    +info(eval("{{db."+ parentDB.get(0) + ".ColumnHeader}}"));+
    Regards,
    *Deepu M*

  • Get parent Collectionset in create Collection

    Hi All,
         In Create Collection, How to get parent collectionset.
    Thanks,
    Dung

    I think you want to post this in the Photoshop Lightroom forum (this is the Lightroom SDK forum, for plugin authors).
    Or have I misunderstood the question? (collection:getParent() to get parent in lua code).
    Or are you trying to call the catalog function to create a collection, but don't know what to use for parent collection set? If this is the case, then you will have to create a collection set if you can't find something suitable to act as parent (e.g. a selected collection set obtained from catalog:getActiveSources()). Reminder: parent parameter is optional - if omitted, then collection will be created in root of catalog (or publish service) - that's another option.
    Most of my plugins that create collections create a collection set in the root, named after the plugin, and put all sub-collections/sets in it.

  • Get parent databank in a child scipt

    Hi All,
    Is there any method to get parent databank in a child script. Currently I'm using variables to pass data from parent script to child script.
    Appreciate if anyone helps me to solve this scenario.
    Regards,
    Deepu M

    Hi,
    Solved.
    If alias name of parent databank always remains same, then you can directly use +"{{db.aliasName.ColumnName}}"+
    Otherwise, to get parent databank alias name use
    ScriptPackage parentScript= utilities.getCurrentVUSer().getParentUser().scriptPackage;
              ArrayList<String> parentDB = parentScript.getDatabankAliases();
    +info(eval("{{db."+ parentDB.get(0) + ".ColumnHeader}}"));+
    Regards,
    *Deepu M*

  • Get parent component

    Hi all,
    Is there any method to get parent component (container) of a jcomponent?

    Did you think to look at the API? Some method names are obvious. Other are not. The least you can do is try. All you had to do was find any method with the word "parent" in it.

  • Getting Parent Consolidation Groups for a given Consolidation Unit

    Hi Friends,
    I am writing a program wherein i need to get parent Consolidation Groups and their Hierarchy levels for a given Consolidation Unit. If anyone has worked on a similar requirement, Please provide me with Function module or logic for the same.
    Thanks
    Surya

    hi,
    asset-nr = ILOA-ANLNR
    Andreas

  • How do i change birthday and get parent approval

    We created a account for our son but we used a different b-day. how do change is birthday and get parent approval. He is a minor.

    Hi mmitchell619,
    Welcome to the Apple Support Communities!
    I understand that you would like to edit the birth date for your son’s Apple ID. To change the birthday, please use the steps located in the following article. 
    Update the birth date associated with your Apple ID - Apple Support
    Best regards,
    Joe

  • How to get the pid for a created process

    hi all,
    i want to get the pid for a newly created process using java. but somebody told to check it in jni. but i didnt get exact solution till now. is anyone there known about this means pls send the code.
    advance thanks
    hidash.....
    i have a personnel mail id u can send ur code to this id
    mailto:[email protected]
    Edited by: Hidash_Kumar on Jan 4, 2008 12:51 AM

    Please run the Process flow and in Execution double click on Job id
    You will see all parameters values in job

  • How to get parent controls reset

    how to get parent control reset or changed

    You would have to log in as the administrator, then use the Parental Controls panel in System preferences to change the account's controls.
    Matt

  • 57F4 challan print - getting parent item no and po number for child item

    Hi ,
    In 57F4 challan, Subcontract components - i.e Child items are used for creating the challans.
    However while printing needs the parent item no with the purchase order number for that child item number.
    It is getting stored in RM07M structure.
    Any inputs / suggestions how to retrive parent item number and purchase order number for child item i.e for subcontract items?
    Thank you .
    Prasad.

    Thank you for the reply. I checked the table RSEG table for material document and PO details, however the RSEG gets populated when there is credit or debit entries.
    In this 57F4 challan there is no credit or debit enteries hence would not get in RSEG table.
    Appreciate your inputs for any other alternative.
    OR is there any table or Function Module to get the enteries of the struture of RM07M .

  • Getting parent-child data from a single column in a table

    Hi,
    I have a parent-child data in a column.
    Eg:
    0
    00
    01
    010
    011
    1
    10
    11
    These values are present in the single column itself. My need is to get the parent values for the given child value.
    For eg: If I am giving the input as 011, the query should return all its parents, i.e. 01 and 0
    Could you please give me any inputs on this?
    Thanks,
    GV

    Frank Kulash wrote:
    Assuming that each child's id is formed by adding exactly one character to the end of its parent's id:
    SELECT     id
    FROM     table_x
    START WITH     id          = :target_id
    CONNECT BY     PRIOR id     LIKE id || '_';
    Small tweak to yours Frank if it's just the parents that need identifying...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select '0' as x from dual union all
      2             select '00' from dual union all
      3             select '01' from dual union all
      4             select '010' from dual union all
      5             select '011' from dual union all
      6             select '1' from dual union all
      7             select '10' from dual union all
      8             select '11' from dual)
      9  -- end of test data
    10  SELECT     x
    11  FROM       t, (select '&required' as req from dual) req
    12  WHERE x != req.req
    13  START WITH x = req.req
    14* CONNECT BY PRIOR x LIKE x || '_'
    SQL> /
    Enter value for required: 011
    old  11: FROM   t, (select '&required' as req from dual) req
    new  11: FROM   t, (select '011' as req from dual) req
    X
    01
    0
    SQL> /
    Enter value for required: 11
    old  11: FROM   t, (select '&required' as req from dual) req
    new  11: FROM   t, (select '11' as req from dual) req
    X
    1
    SQL>

  • How to get parents data from a leaf in a recursive table

    I want to get a list of all parents data related to a leaf in a table.
    The table has 3 rows id, description, parent.
    if I have the id of one of this items I want to get all his parents, is there a way to get this with a select or with connect by prior?

    Maybe
    select substr(sys_connect_by_path(to_char(empno),','),2) parant_chain
      from emp
    where connect_by_isleaf = 1
    start with empno = 7369
    connect by empno = prior mgr
    PARANT_CHAIN
    7369,7902,7566,7839
    Regards
    Etbin

Maybe you are looking for

  • Dev server the dispatcher is not getting start

    Dear all , We are facing problem in dev server the dispatcher is not getting started. Plese suggest The log file . trc file: "dev_w0", trc level: 1, release: "640" ACTIVE TRACE LEVEL           1 ACTIVE TRACE COMPONENTS      all, M B  B Mon Oct 05 08:

  • Itunes 11.1.4.62 does not detect existing iphone or ipad

    Just downloaded the above, and now on plugging in either my existing iphone or my Ipad via wired USB connection, itunes does not detect the device.  Running windows 8.1, Tried updated iphone software to match as well, still no detection.  Am I missin

  • Microsoft Livecam HD-3000 issues, tried re-install...

    Hey there, I have Windows 7 64-bit and Skype 7.0.102 My HD-3000 Webcam was working fine before and now isn't working at all. Skype is picking it up, but when I press the camera button or try to go into the options to choose the webcam, it just keeps

  • Posting Peroiods closed by user id .

    Hello Posting periods are closed by some user , there is table we can find the user id and peroid closing . iam unable to recall .any body help me OMSY entyies updated in to whicjh table @sakhi

  • Golive readiness

    Hi all, Could you please provide the details or the check list for the SAP XI readiness 1. while moving the objects from dev to prod since the objects are in different SLDs like grouping of TS etc 2. The necessary backup and disaster receovery plans