Index: /branches/rel_apv_10_7/usr/click/bin/backend/ntp.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/bin/backend/ntp.c	(revision 38400)
+++ /branches/rel_apv_10_7/usr/click/bin/backend/ntp.c	(working copy)
@@ -114,7 +114,7 @@
 static int get_ntpsrv_info(const char *info,struct ntpsrv_info *ntpinfo);
 static int update_ntpsrv_conf(char* ip, unsigned int version);
 static int get_conf_file_size(const char *filename);
-
+static int is_ntp_service_active();
 
 static int
 is_ntpsrv_ipv6_exist(struct in6_addr *ip,unsigned int version)
@@ -418,6 +418,28 @@
     return strcpy(servers, buf);
 }
 
+static int 
+is_ntp_service_active() {
+    char command[256];
+    snprintf(command, sizeof(command), "systemctl is-active ntpd");
+
+    FILE *fp = popen(command, "r");
+    if (fp == NULL) {
+        perror("popen");
+        return -1;
+    }
+
+    char result[128];
+    if (fgets(result, sizeof(result), fp) == NULL) {
+        pclose(fp);
+        return 0;
+    }
+
+    pclose(fp);
+
+    return strncmp(result, "active", 6) == 0;
+}
+
 int
 ui_ntpon(int ntp_type)
 {
@@ -453,7 +475,10 @@
 #else
 		system("systemctl start ntpdate");
 #endif
-		if (system("systemctl start ntpd") != 0) {
+		/* In an HA bootup sync environment, starting ntpd returns non-zero for unknown reasons, 
+		   but the service is running fine. Add a workaround to check if ntpd is not running 
+		   before handling the error. */
+		if (system("systemctl start ntpd") != 0 && !is_ntp_service_active()) {
 			system("systemctl stop ntpd");
 			printf("Failed to turn NTP on\n");
 			return -1;
