From: Ken'ichi Ohmichi Date: Mon, 6 Jul 2009 04:42:36 +0000 (+0900) Subject: Add a process name to the log of cgrulesengd daemon. X-Git-Tag: v0.35~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b75a9fcfab5cd2ae88a55934e22c77cbd6810a14;p=thirdparty%2Flibcgroup.git Add a process name to the log of cgrulesengd daemon. Hi, Current cgrulesengd daemon changes the cgroup of each process by a rule based on uid, gid, and process name. And it is good that the log of the daemon contains a process name with uid and gid. This patch adds a process name to the log message. Thanks Ken'ichi Ohmichi Signed-off-by: Ken'ichi Ohmichi Signed-off-by: Dhaval Giani --- diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c index 38e4f60f..4b04f3b4 100644 --- a/src/daemon/cgrulesengd.c +++ b/src/daemon/cgrulesengd.c @@ -436,13 +436,14 @@ int cgre_process_event(const struct proc_event *ev, const int type) /* A process finished already and that is not a problem. */ ret = 0; } else if (ret) { - flog(LOG_WARNING, "Cgroup change for PID: %d, UID: %d, GID: %d" - " FAILED! (Error Code: %d)", log_pid, log_uid, log_gid, - ret); + flog(LOG_WARNING, "Cgroup change for PID: %d, UID: %d, GID: %d," + " PROCNAME: %s FAILED! (Error Code: %d)", + log_pid, log_uid, log_gid, procname, ret); } else { + flog(LOG_INFO, "Cgroup change for PID: %d, UID: %d, GID: %d," + " PROCNAME: %s OK", + log_pid, log_uid, log_gid, procname); ret = cgre_store_parent_info(pid); - flog(LOG_INFO, "Cgroup change for PID: %d, UID: %d, GID: %d OK", - log_pid, log_uid, log_gid); } free(procname); return ret;