Say i have a pid file and want to find if a process with this pid exists. I can read the number from the file but don't know how to look up process w/o using external tools. <processtest> wants a name, not pid.

asked 15 Feb '12, 07:03

Dmitry%20Bezer's gravatar image

Dmitry Bezer
accept rate: 0%

If you just need to do that in Linux you could just use a <runProgram> action to call ps

   <programArguments>-p ${pid}</programArguments>

And then check if ${program_exit_code} is 0 (it exists).


answered 16 Feb '12, 18:24

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Hi Juanjo, Sure you can so this with ps on unix like system and qprocess.exe on windows, i was just wondering if i could do this by means of Bitrock script only . Thats why i wrote "look up process w/o using external tools" ;) If I were a Bitrock developer I would add "pid" parameter to the <processtest> :)

(17 Feb '12, 06:23) Dmitry Bezer

Sorry, I missed that :). We have added your suggestion to our bug tracking system. An improvement of using the system tools would be to wrap it in a custom action so you keep your code platform independent. You can find additional details about custom actions in our online docs:

(17 Feb '12, 06:38) juanjo ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 15 Feb '12, 07:03

Seen: 1,110 times

Last updated: 17 Feb '12, 06:38