write a pid file for elasticsearch