CPG lock daemon and library