Harald Hoyer 460d2c
From 5c025a7d2a53cd63c7a94269aec2887e016ba2d6 Mon Sep 17 00:00:00 2001
Harald Hoyer 460d2c
From: Kairui Song <kasong@redhat.com>
Harald Hoyer 460d2c
Date: Wed, 10 Jun 2020 18:28:27 +0800
Harald Hoyer 460d2c
Subject: [PATCH] 99memstrack: Only start tracking service when rd.memdebug=4|5
Harald Hoyer 460d2c
Harald Hoyer 460d2c
Currently systemd will always start the tracking service, it will
Harald Hoyer 460d2c
exit early if rd.memdebug<=3 so there is no issue here, but it
Harald Hoyer 460d2c
leave a message of: "Started Memstrack Anylazing Service.".
Harald Hoyer 460d2c
Better to avoid such message if it's not used.
Harald Hoyer 460d2c
Harald Hoyer 460d2c
Signed-off-by: Kairui Song <kasong@redhat.com>
Harald Hoyer 460d2c
---
Harald Hoyer 460d2c
 modules.d/99memstrack/memstrack.service | 2 ++
Harald Hoyer 460d2c
 1 file changed, 2 insertions(+)
Harald Hoyer 460d2c
Harald Hoyer 460d2c
diff --git a/modules.d/99memstrack/memstrack.service b/modules.d/99memstrack/memstrack.service
Harald Hoyer 460d2c
index c9fcadef..fce373b5 100644
Harald Hoyer 460d2c
--- a/modules.d/99memstrack/memstrack.service
Harald Hoyer 460d2c
+++ b/modules.d/99memstrack/memstrack.service
Harald Hoyer 460d2c
@@ -3,6 +3,8 @@ Description=Memstrack Anylazing Service
Harald Hoyer 460d2c
 DefaultDependencies=no
Harald Hoyer 460d2c
 Before=dracut-cmdline.service systemd-udevd.service local-fs-pre.target
Harald Hoyer 460d2c
 IgnoreOnIsolate=true
Harald Hoyer 460d2c
+ConditionKernelCommandLine=|rd.memdebug=4
Harald Hoyer 460d2c
+ConditionKernelCommandLine=|rd.memdebug=5
Harald Hoyer 460d2c
 
Harald Hoyer 460d2c
 [Service]
Harald Hoyer 460d2c
 Type=simple
Harald Hoyer 460d2c