Hi,

This patch reduces spam log messages "Cgroup change for PID:X, UID:X, GID:X
FAILED!" by deleting the messages when "No such process" error happens.


Thanks
Ken'ichi Ohmichi

Signed-off-by: Ken'ichi Ohmichi <[email protected]>
---
 src/daemon/cgrulesengd.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c
index f6a3f8d..0c18709 100644
--- a/src/daemon/cgrulesengd.c
+++ b/src/daemon/cgrulesengd.c
@@ -357,13 +357,11 @@ int cgre_process_event(const struct proc_event *ev, const 
int type)
        }
 
        if (ret) {
-               /*
-                * TODO: add some supression, do not spam log when every group
-                * change fails
-                */
-               flog(LOG_WARNING, "Cgroup change for PID: %d, UID: %d, GID: %d"
-                       " FAILED! (Error Code: %d)", log_pid, log_uid, log_gid,
-                       ret);
+               if ((ret != ECGOTHER) || (errno != ESRCH)) {
+                       flog(LOG_WARNING, "Cgroup change for PID: %d, UID: %d,",
+                               " GID: %d FAILED! (Error Code: %d)",
+                               log_pid, log_uid, log_gid, ret);
+               }
        } else {
                ret = cgre_store_parent_info(pid);
                flog(LOG_INFO, "Cgroup change for PID: %d, UID: %d, GID: %d OK",

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to