# How to get script/runner to write its PID to a file?

**URL:** <https://www.ruby-forum.com/t/how-to-get-script-runner-to-write-its-pid-to-a-file/192874>\
**Category:** Rails\
**Created:** [August 7, 2010, 2:34pm UTC](https://www.ruby-forum.com/t/how-to-get-script-runner-to-write-its-pid-to-a-file/192874 "2010-08-07T14:34:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PierreW](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/da6949/32.png) [@PierreW](https://www.ruby-forum.com/u/PierreW)\
**Post date:** [August 7, 2010, 2:34pm UTC](https://www.ruby-forum.com/t/how-to-get-script-runner-to-write-its-pid-to-a-file/192874/1 "2010-08-07T14:34:11Z")

</div>

Hello!

I must be missing something obvious (and yet I have tried a lot of  
things):

how can you get script/runner to write its PID to a file (and specify  
the location)?

I could do it manually in the code itself, but I guess this  
functionality is built-in already.

Thanks!  
Peter
