Results 1 to 2 of 2

Thread: [RESOLVED] [POSIX] fork() and setting process name of new process

Threaded View

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Resolved [RESOLVED] [POSIX] fork() and setting process name of new process

    Does anyone known how to specify the name of a child process that is created using the fork() function?

    I want to be able to fork() 4 times and have each process have a different name to make debugging easier and also so that users can kill the processes by name if a problem occurs.

    I have just found this page (http://www.uofr.net/~greg/processname.html) which would work but is a bit nasty as it depends on the length of the original parent's name. And also it only changes the commandline string not the actual process name.

    My aim is to have something nice in "top" output like...

    parent00
    fork00_01
    fork00_02
    fork00_03
    fork00_04


    Currently all 5 of my processes have the same name and its impossible to tell them apart except by their process IDs, which isn't ideal.

    Any ideas?
    Last edited by wossname; Jun 8th, 2008 at 08:54 AM.
    I don't live here any more.

Posting Permissions

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



Click Here to Expand Forum to Full Width