Create pid file if requested.
Merge branch 'pid'