From a033a43bea41cb681707905d52e385a970c4a11c Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Mon, 30 Dec 2024 14:55:15 +0900 Subject: [PATCH] Change MemoryMax constraint in asan envrionment In asan environment, it uses more memory for asan check and MemoryMax=30M is not enough. To avoid oom-kill of contextd in asan envrionment, change MemoryMax in asan envrionment with different asan conf file in contextd.service.d directory. Change-Id: Ifb854cecfeeb4e7550511ce0c8eb1246e74beaa8 Signed-off-by: Seung-Woo Kim --- packaging/context-service.spec | 9 +++++++++ packaging/contextd.asan.conf | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 packaging/contextd.asan.conf diff --git a/packaging/context-service.spec b/packaging/context-service.spec index 1d44fa7..5e449a8 100644 --- a/packaging/context-service.spec +++ b/packaging/context-service.spec @@ -9,6 +9,7 @@ Source1: contextd.service Source2: org.tizen.context.conf Source3: contextd-agent.service Source4: contextd-agent.socket +Source5: contextd.asan.conf BuildRequires: cmake BuildRequires: pkgconfig(libsystemd) @@ -67,6 +68,11 @@ install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir_user} install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir_user} ln -s ../contextd-agent.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/contextd-agent.socket +%if "%{asan}" == "1" +mkdir -p %{buildroot}%{_unitdir}/contextd.service.d +install -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/contextd.service.d +%endif + %files %manifest packaging/%{name}.manifest %config %{_sysconfdir}/dbus-1/system.d/* @@ -74,6 +80,9 @@ ln -s ../contextd-agent.socket %{buildroot}%{_unitdir_user}/sockets.target.wants %{_unitdir}/contextd.service %{_unitdir}/*/contextd.service %license LICENSE +%if "%{asan}" == "1" +%{_unitdir}/contextd.service.d/contextd.asan.conf +%endif %files -n context-agent %manifest packaging/%{name}.manifest diff --git a/packaging/contextd.asan.conf b/packaging/contextd.asan.conf new file mode 100644 index 0000000..af1713a --- /dev/null +++ b/packaging/contextd.asan.conf @@ -0,0 +1,2 @@ +[Service] +MemoryMax=64M -- 2.34.1