How to find if a process with specific pid is running?

Comments

1 comment

  • Avatar
    juanjo

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

    <runProgram>
       <abortOnError>0</abortOnError>
       <showMessageOnError>0</showMessageOnError>
       <program>ps</program>
       <programArguments>-p ${pid}</programArguments>
    </runProgram>
    

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

Please sign in to leave a comment.