Index: /branches/rel_avx_2_7_6/scripts/chrony_setup.py
===================================================================
--- /branches/rel_avx_2_7_6/scripts/chrony_setup.py	(revision 9235)
+++ /branches/rel_avx_2_7_6/scripts/chrony_setup.py	(working copy)
@@ -121,10 +121,14 @@
         lines = f.readlines()
 
     # Filter out lines that match the server/pool
-    lines = [line for line in lines if server not in line]
+    new_lines = [line for line in lines if server not in line]
+
+    if len(lines) == len(new_lines):
+        print("Error: NTP server IP or URL is not found.")
+        return
 
     with open(CHRONY_CONFIG_FILE, "w") as f:
-        f.writelines(lines)
+        f.writelines(new_lines)
 
     # Manipulating chronyc may not always work reliably
     # Restarting the service ensures the changes are applied
Index: /branches/rel_avx_2_7_6/src/backend/ntp.c
===================================================================
--- /branches/rel_avx_2_7_6/src/backend/ntp.c	(revision 9235)
+++ /branches/rel_avx_2_7_6/src/backend/ntp.c	(working copy)
@@ -520,8 +520,26 @@
 int ui_ntp_remove_server(char *ip){
 	// reuse this function for handling chrony client
 	char cmd[256] = {0};
+	FILE *fp;
+	char path[1035];
+
 	snprintf(cmd, sizeof(cmd), "python /ca/bin/chrony_setup.py -r %s", ip);
-	system(cmd);
+
+	/* Open the command for reading. */
+	fp = popen(cmd, "r");
+	if (fp == NULL) {
+		printf("Failed to run command\n");
+		return 1;
+	}
+
+	/* Read the output a line at a time - output it to stdout or process it. */
+	while (fgets(path, sizeof(path)-1, fp) != NULL) {
+		printf("%s", path);
+	}
+
+	/* Close the file pointer. */
+	pclose(fp);
+
 	return 0;
 }
 
