Results 1 to 4 of 4

Thread: [SOLVED] Reassign process parent / PPID

  1. #1
    Join Date
    Jan 2008
    Beans
    75

    [SOLVED] Reassign process parent / PPID

    Hi,

    Is it possible to reassign the PPID / parent process ID of a process (i.e. shift it to a different node in the process tree).

    For example, I can open a terminal (process PPID=1) and execute a program in it (process PPID = terminal PID). Later I want to reassign the PPID to that of the GUI apps or something else (another application) - is that possible?

    I can execute programs in the terminal using nohup command, which assigns the process a PPID of 1 - but that does not apply to already running processes or shifting to a different process. Also I can use screen to get applications running when the terminal closes, but again not useful for running processes / creating that process tree relationship when things get killed.

    Thanks for any help, Jon

  2. #2

    Re: Reassign process parent / PPID

    Quote Originally Posted by jon.mithe View Post
    Is it possible to reassign the PPID / parent process ID of a process (i.e. shift it to a different node in the process tree).
    Nope, a process will get adopted by init if its parent die/exit, other than that, nothing can change a ppid (AFAIK).

  3. #3
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Reassign process parent / PPID

    I'm not sure if it's possible to reassign a process to a new parent however, you can disassociate it while it's running using "disown". For example:

    Code:
    gcalctool &
    exit
    The calculator closes.

    Code:
    gcalctool &
    disown
    exit
    The calculator stays open. You can also use "disown -a" to disown all background child processes of the currently shell.
    Don't try to make something "fast" until you are able to quantify "slow".

  4. #4
    Join Date
    Jan 2008
    Beans
    75

    Re: Reassign process parent / PPID

    Thats worked great thanks

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •