Add pidfile support