add pidfile support