[controller] add pidfile support