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 <[email protected]>
---
 src/daemon/cgrulesengd.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c
index 38e4f60..4b04f3b 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;

------------------------------------------------------------------------------
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to