From cfb3a9f2b968ff5d136950b4b0131fa9c7c04a17 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 12 Mar 2021 00:35:13 +0100 Subject: [PATCH] plugins: pidfile: reduce log noise With the new practise of keeping record of process pid files, we no longer need to log/update when reading back the same PID we already have on file. Signed-off-by: Joachim Wiberg --- plugins/pidfile.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/pidfile.c b/plugins/pidfile.c index fbd525c0..50026dc8 100644 --- a/plugins/pidfile.c +++ b/plugins/pidfile.c @@ -91,9 +91,11 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask) pid_t pid; pid = pid_file_read(pid_file(svc)); - _d("Forking service %s changed PID from %d to %d", - svc->cmd, svc->pid, pid); - svc->pid = pid; + if (pid != svc->pid) { + _d("Forking service %s changed PID from %d to %d", + svc->cmd, svc->pid, pid); + svc->pid = pid; + } } cond_set(cond);