Blob Blame History Raw
From 5c025a7d2a53cd63c7a94269aec2887e016ba2d6 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 10 Jun 2020 18:28:27 +0800
Subject: [PATCH] 99memstrack: Only start tracking service when rd.memdebug=4|5

Currently systemd will always start the tracking service, it will
exit early if rd.memdebug<=3 so there is no issue here, but it
leave a message of: "Started Memstrack Anylazing Service.".
Better to avoid such message if it's not used.

Signed-off-by: Kairui Song <kasong@redhat.com>
---
 modules.d/99memstrack/memstrack.service | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules.d/99memstrack/memstrack.service b/modules.d/99memstrack/memstrack.service
index c9fcadef..fce373b5 100644
--- a/modules.d/99memstrack/memstrack.service
+++ b/modules.d/99memstrack/memstrack.service
@@ -3,6 +3,8 @@ Description=Memstrack Anylazing Service
 DefaultDependencies=no
 Before=dracut-cmdline.service systemd-udevd.service local-fs-pre.target
 IgnoreOnIsolate=true
+ConditionKernelCommandLine=|rd.memdebug=4
+ConditionKernelCommandLine=|rd.memdebug=5
 
 [Service]
 Type=simple