From 7468269cc9e230683bc7cbaf9cf1a6ed4807ccf1 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Tue, 19 Feb 2019 17:15:56 +0100 Subject: [PATCH] Disable log_dump Disable log_dump for the period of spawn API introduction to avoid rewriting this utility twice. Change-Id: I7f5589d9e3eadb4343314d5509c6dc8cf4e62177 --- CMakeLists.txt | 7 +++++-- packaging/crash-worker.spec | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a14531..8003dae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,11 @@ IF("${SYS_ASSERT}" STREQUAL "ON") ENDIF("${SYS_ASSERT}" STREQUAL "ON") ADD_SUBDIRECTORY(src/crash-stack) - ADD_SUBDIRECTORY(src/dump_systemstate) -ADD_SUBDIRECTORY(src/log_dump) + +IF("${LOG_DUMP}" STREQUAL "ON") + ADD_SUBDIRECTORY(src/log_dump) +ENDIF() + ADD_SUBDIRECTORY(tests) diff --git a/packaging/crash-worker.spec b/packaging/crash-worker.spec index 42835d6..e3bec87 100644 --- a/packaging/crash-worker.spec +++ b/packaging/crash-worker.spec @@ -5,6 +5,7 @@ %bcond_with doc %bcond_with sys_assert %bcond_with tests +%bcond_with logdump # NOTE: To disable coredump set DumpCore=0 in configuration file @@ -112,6 +113,7 @@ export CFLAGS+=" -Werror" -DCRASH_STACK_PATH=%{_libexecdir}/crash-stack \ -DCRASH_TESTS_PATH=%{_libdir}/crash-worker-tests \ -DSYS_ASSERT=%{on_off sys_assert} \ + -DLOG_DUMP=%{on_off logdump} \ -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \ make %{?jobs:-j%jobs} @@ -127,10 +129,12 @@ mkdir -p %{buildroot}%{crash_path} mkdir -p %{buildroot}%{crash_temp} # log_dump dir +%if %{with logdump} mkdir -p %{buildroot}%{crash_all_log} mkdir -p %{buildroot}%{crash_dump_gen} cp dump_scripts/* %{buildroot}%{crash_dump_gen} chmod 755 %{buildroot}%{crash_dump_gen}/* +%endif %post %if %{with sys_assert} @@ -149,10 +153,13 @@ fi /usr/bin/chsmack -a "System" -t %{crash_path} /usr/bin/chsmack -a "System" -t %{crash_temp} + +%if %{with logdump} /usr/bin/chsmack -a "System" -t %{crash_dump_gen} /usr/bin/chsmack -a "System" -t %{crash_dump_gen}/module.d /usr/bin/chsmack -a "System::Shared" -t %{crash_all_log} /usr/bin/chsmack -a "_" %{crash_dump_gen}/module.d/* +%endif %postun %if %{with sys_assert} @@ -169,15 +176,21 @@ sed -i "/${pattern}/D" %{_sysconfdir}/ld.so.preload %dir %{crash_root_path} %dir %{crash_path} %dir %{crash_temp} +%{_sysconfdir}/crash-manager.conf +%attr(-,root,root) %{_prefix}/lib/sysctl.d/99-crash-manager.conf +%attr(0750,system_fw,system_fw) %{_bindir}/crash-manager +%attr(0750,system_fw,system_fw) %{_bindir}/dump_systemstate +%{_libexecdir}/crash-stack + +%if %{with logdump} %dir %{crash_all_log} %{crash_dump_gen}/* -%attr(0750,system_fw,system_fw) %{_bindir}/* %attr(-,root,root) %{_unitdir}/log_dump.service -%{_sysconfdir}/crash-manager.conf %attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/log_dump.conf -%attr(-,root,root) %{_prefix}/lib/sysctl.d/99-crash-manager.conf %attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.service -%{_libexecdir}/crash-stack +%attr(0750,system_fw,system_fw) %{_bindir}/log_dump +%endif + %if %{with sys_assert} %{_libdir}/libsys-assert.so %{_sysconfdir}/tmpfiles.d/sys-assert.conf -- 2.7.4