Blob Blame History Raw
diff -up libcgroup-0.40.rc1/scripts/init.d/cgred.in.empty-config libcgroup-0.40.rc1/scripts/init.d/cgred.in
--- libcgroup-0.40.rc1/scripts/init.d/cgred.in.empty-config	2013-08-26 14:24:16.070531165 +0200
+++ libcgroup-0.40.rc1/scripts/init.d/cgred.in	2013-08-26 14:24:16.072531149 +0200
@@ -81,10 +81,6 @@ start()
 		log_failure_msg "$servicename is already running with PID `cat ${pidfile}`"
 		return 0
 	fi
-	if [ ! -s $CGRED_CONF ]; then
-		log_failure_msg "not configured"
-		return 6
-	fi
 	if ! grep "^cgroup" /proc/mounts &>/dev/null; then
 		echo
 		log_failure_msg $"Cannot find cgroups, is cgconfig service running?"
diff -up libcgroup-0.40.rc1/src/api.c.empty-config libcgroup-0.40.rc1/src/api.c
--- libcgroup-0.40.rc1/src/api.c.empty-config	2013-05-21 15:36:04.000000000 +0200
+++ libcgroup-0.40.rc1/src/api.c	2013-08-26 14:24:16.073531142 +0200
@@ -541,17 +541,6 @@ static int cgroup_parse_rules(bool cache
 	/* Loop variable. */
 	int i = 0;
 
-	/* Open the configuration file. */
-	pthread_rwlock_wrlock(&rl_lock);
-	fp = fopen(CGRULES_CONF_FILE, "re");
-	if (!fp) {
-		cgroup_err("Error: failed to open configuration file %s: %s\n",
-				CGRULES_CONF_FILE, strerror(errno));
-		last_errno = errno;
-		ret = ECGOTHER;
-		goto unlock;
-	}
-
 	/* Determine which list we're using. */
 	if (cache)
 		lst = &rl;
@@ -562,6 +551,15 @@ static int cgroup_parse_rules(bool cache
 	if (lst->head)
 		cgroup_free_rule_list(lst);
 
+	/* Open the configuration file. */
+	pthread_rwlock_wrlock(&rl_lock);
+	fp = fopen(CGRULES_CONF_FILE, "re");
+	if (!fp) {
+		cgroup_warn("Warning: failed to open configuration file %s: %s\n",
+				CGRULES_CONF_FILE, strerror(errno));
+		goto unlock;
+	}
+
 	/* Now, parse the configuration file one line at a time. */
 	cgroup_dbg("Parsing configuration file.\n");
 	while (fgets(buff, sizeof(buff), fp) != NULL) {