How to get PID of current rake task?

Solution 1:

You get the current PID in Ruby with Process.pid