diff --git a/monkey/monkey_island/cc/main.py b/monkey/monkey_island/cc/main.py index cf56144ed..497323f8b 100644 --- a/monkey/monkey_island/cc/main.py +++ b/monkey/monkey_island/cc/main.py @@ -41,6 +41,8 @@ def main( ): logger.info("Starting bootloader server") + create_data_dir(data_dir) + env_singleton.initialize_from_file(server_config_filename) initialize_encryptor(data_dir) initialize_services(data_dir) @@ -55,6 +57,11 @@ def main( bootloader_server_thread.join() +def create_data_dir(data_dir): + if not os.path.isdir(data_dir): + os.makedirs(data_dir, mode=0o700) + + def start_island_server(should_setup_only): mongo_url = os.environ.get("MONGO_URL", env_singleton.env.get_mongo_url()) wait_for_mongo_db_server(mongo_url)