[kactivities] kactivitymanager doesn't respond on SIGTERM when shutdown the system (kde#305353)
Rex Dieter
rdieter at fedoraproject.org
Fri Apr 26 15:07:59 UTC 2013
commit 3a0cfdb03f8d238036396bd89c7517b729256f50
Author: Rex Dieter <rdieter at math.unl.edu>
Date: Fri Apr 26 10:07:41 2013 -0500
kactivitymanager doesn't respond on SIGTERM when shutdown the system (kde#305353)
kactivities-4.10.2-drop_signal_handler.patch | 63 ++++++++++++++++++++++++++
kactivities.spec | 13 +++++-
2 files changed, 75 insertions(+), 1 deletions(-)
---
diff --git a/kactivities-4.10.2-drop_signal_handler.patch b/kactivities-4.10.2-drop_signal_handler.patch
new file mode 100644
index 0000000..f2adaa2
--- /dev/null
+++ b/kactivities-4.10.2-drop_signal_handler.patch
@@ -0,0 +1,63 @@
+diff -up kactivities-4.10.2/src/service/Application.cpp.drop_signal_handler kactivities-4.10.2/src/service/Application.cpp
+--- kactivities-4.10.2/src/service/Application.cpp.drop_signal_handler 2013-03-01 00:26:31.971556302 -0600
++++ kactivities-4.10.2/src/service/Application.cpp 2013-04-26 10:04:14.458323124 -0500
+@@ -223,8 +223,6 @@ void Application::quit()
+
+ // Leaving object oriented world :)
+
+-static void initSignalCatching();
+-
+
+ int main(int argc, char ** argv)
+ {
+@@ -236,50 +234,6 @@ int main(int argc, char ** argv)
+
+ KCmdLineArgs::init(argc, argv, &about);
+
+- if (!KCmdLineArgs::allArguments().contains("--nofork"))
+- initSignalCatching();
+-
+ return Application::self()->exec();
+ }
+
+-// Signal handling
+-static void signalHandler(int sig)
+-{
+- Jobs::Encryption::Common::unmountAll();
+-
+- Application::quit();
+-
+- // something (probably ksmserver) has asked us to terminate.
+- // If it is really ksmserver then the user is probably logging out, so we
+- // had better gently stop now than be killed.
+- if (sig == SIGTERM) {
+- //qDebug() << "signalHandler(SIGTERM): stopping ActivityManager\n";
+-
+- // ActivityManager::self()->Stop();
+- }
+-
+- // If we have crashed, then restart
+- if (sig == SIGSEGV) {
+- qDebug() << "Calling the crash handler...";
+- KCrash::defaultCrashHandler(SIGSEGV);
+- }
+-
+- ::exit(EXIT_SUCCESS);
+-}
+-
+-static void initSignalCatching() {
+-#ifndef Q_OS_WIN32 // krazy:skip
+- struct sigaction action;
+-
+- ::sigemptyset(&action.sa_mask);
+- action.sa_flags = 0;
+-
+- /* Use the sa_sigaction field because the handles has two additional parameters */
+- action.sa_handler = signalHandler;
+-
+- ::sigaction(SIGINT, &action, nullptr);
+- ::sigaction(SIGHUP, &action, nullptr);
+- ::sigaction(SIGTERM, &action, nullptr);
+- ::sigaction(SIGSEGV, &action, nullptr);
+-#endif
+-}
diff --git a/kactivities.spec b/kactivities.spec
index 2d2190a..7c1ac63 100644
--- a/kactivities.spec
+++ b/kactivities.spec
@@ -1,7 +1,7 @@
Name: kactivities
Summary: API for using and interacting with Activities
Version: 4.10.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2+ and LGPLv2+
URL: https://projects.kde.org/projects/kde/kdelibs/kactivities
@@ -13,6 +13,12 @@ URL: https://projects.kde.org/projects/kde/kdelibs/kactivities
%endif
Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar.xz
+## Upstreamable patches
+# drop signal handlers that prevent kactivitymangerd exit on logout
+# https://bugs.kde.org/show_bug.cgi?id=305353
+# backport from master/ branch
+Patch50: kactivities-4.10.2-drop_signal_handler.patch
+
BuildRequires: kdelibs4-devel >= %{version}
BuildRequires: nepomuk-core-devel >= %{version}
@@ -48,6 +54,8 @@ Requires: kdelibs4-devel
%prep
%setup -q
+%patch50 -p1 -b .drop_signal_handler
+
%build
mkdir -p %{_target_platform}
@@ -129,6 +137,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform}-devtoolset/src/wor
%changelog
+* Fri Apr 26 2013 Rex Dieter <rdieter at fedoraproject.org> 4.10.2-2
+- kactivitymanager doesn't respond on SIGTERM when shutdown the system (kde#305353)
+
* Sun Mar 31 2013 Rex Dieter <rdieter at fedoraproject.org> - 4.10.2-1
- 4.10.2
More information about the scm-commits
mailing list