Smooth pidfile management
Update logging