If you are upgrading or similar, using maapi_init_upgrade() is best practice. That will terminate CLI config sessions and lock CDB. If an existing CLI user tries to enter config mode there will be a message saying “In upgrade mode, please wait”. A timeout and a message can be provided to existing CLI users before their config mode session is terminated. See ConfD UG chapter “In-service Upgrade”. You can use the confd_cmd -c “upgrade_interactive” command to test.