summaryrefslogtreecommitdiffstats
path: root/claim/claim.c
diff options
context:
space:
mode:
Diffstat (limited to 'claim/claim.c')
-rw-r--r--claim/claim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/claim/claim.c b/claim/claim.c
index c919fa3bd..9c7e97e9e 100644
--- a/claim/claim.c
+++ b/claim/claim.c
@@ -161,7 +161,11 @@ void load_claiming_state(void)
freez(claimed_id);
claimed_id = NULL;
}
- localhost->aclk_state.claimed_id = claimed_id;
+
+ if(claimed_id) {
+ localhost->aclk_state.claimed_id = mallocz(UUID_STR_LEN);
+ uuid_unparse_lower(uuid, localhost->aclk_state.claimed_id);
+ }
invalidate_node_instances(&localhost->host_uuid, claimed_id ? &uuid : NULL);
store_claim_id(&localhost->host_uuid, claimed_id ? &uuid : NULL);
@@ -172,6 +176,8 @@ void load_claiming_state(void)
return;
}
+ freez(claimed_id);
+
info("File '%s' was found. Setting state to AGENT_CLAIMED.", filename);
netdata_cloud_setting = appconfig_get_boolean(&cloud_config, CONFIG_SECTION_GLOBAL, "enabled", 1);
#endif