diff --git a/src/server.cpp b/src/server.cpp index 990493121..b648c3d6f 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -6427,13 +6427,6 @@ void redisAsciiArt(void) { serverLogRaw(LL_NOTICE|LL_RAW,buf); } - if (cserver.license_key == nullptr && !g_pserver->sentinel_mode) - { -#ifndef NO_LICENSE_CHECK - serverLog(LL_WARNING, "!!!! KeyDB Enterprise is being run in trial mode !!!!"); - serverLog(LL_WARNING, "!!!! Execution will terminate in %d minutes !!!!", cserver.trial_timeout); -#endif - } zfree(buf); } @@ -7321,6 +7314,13 @@ int main(int argc, char **argv) { serverLog(LL_WARNING, "Configuration loaded"); } +#ifndef NO_LICENSE_CHECK + if (!g_pserver->sentinel_mode && (cserver.license_key == nullptr || !FValidKey(cserver.license_key, strlen(cserver.license_key)))){ + serverLog(LL_WARNING, "Error: %s license key provided, exiting immediately.", cserver.license_key == nullptr ? "No" : "Invalid"); + exit(1); + } +#endif + validateConfiguration(); const char *err; diff --git a/src/server.h b/src/server.h index 2cf5646d9..6a318fcd6 100644 --- a/src/server.h +++ b/src/server.h @@ -2115,7 +2115,7 @@ struct redisServerConst { int enable_motd; /* Flag to retrieve the Message of today using CURL request*/ sds license_key = nullptr; - int trial_timeout = 120; + int trial_timeout = 0; int delete_on_evict = false; // Only valid when a storage provider is set int thread_min_client_threshold = 50; int multimaster_no_forward;