From b6811f6643d98858cf1d63904bcdfe240c705950f2650744b77e8915e788bf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 24 Aug 2016 08:16:29 +0000 Subject: [PATCH 1/2] Accepting request 421482 from home:VictorYang:branches:X11:windowmanagers bnc#977233 modify the command to correct one OBS-URL: https://build.opensuse.org/request/show/421482 OBS-URL: https://build.opensuse.org/package/show/X11:windowmanagers/icewm?expand=0&rev=66 --- icewm-preferences.patch | 4 ++-- icewm.changes | 6 ++++++ icewm.spec | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/icewm-preferences.patch b/icewm-preferences.patch index 43c136f..79f3d06 100644 --- a/icewm-preferences.patch +++ b/icewm-preferences.patch @@ -44,11 +44,11 @@ Index: src/preferences # Command to shutdown the system -# ShutdownCommand="/bin/sh -c "{ test -e /run/systemd/system && systemctl poweroff; } ||:"" -+ShutdownCommand="/bin/sh -c "systemctl poweroff ||:"" ++ShutdownCommand="/bin/sh -c 'systemctl poweroff ||:'" # Command to reboot the system -# RebootCommand="/bin/sh -c "{ test -e /run/systemd/system && systemctl reboot; } ||:"" -+RebootCommand="/bin/sh -c "systemctl reboot ||:"" ++RebootCommand="/bin/sh -c 'systemctl reboot ||:'" # Command to run on CPU status # CPUStatusCommand="xterm -name top -title Process\ Status -e top" diff --git a/icewm.changes b/icewm.changes index 7d6d729..31987f3 100644 --- a/icewm.changes +++ b/icewm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 24 07:55:56 UTC 2016 - tyang@suse.com + +- Modify: icewm-preferences.patch + bnc#977233 modify the command to correct one. + ------------------------------------------------------------------- Thu Jun 2 11:30:11 UTC 2016 - tchvatal@suse.com diff --git a/icewm.spec b/icewm.spec index 4a899d0..7161298 100644 --- a/icewm.spec +++ b/icewm.spec @@ -1,7 +1,7 @@ # # spec file for package icewm # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed From f5249fe7fa881bb6010047699aac70b3b0ed6272544e7c7a0436a23e51185179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 25 Aug 2016 16:25:45 +0000 Subject: [PATCH 2/2] Accepting request 422149 from home:favogt:branches:X11:windowmanagers Add patch icewm-exit-fork.patch to avoid deadlock (bsc#977233) OBS-URL: https://build.opensuse.org/request/show/422149 OBS-URL: https://build.opensuse.org/package/show/X11:windowmanagers/icewm?expand=0&rev=67 --- icewm-exit-fork.patch | 64 +++++++++++++++++++++++++++++++++++++++++++ icewm.changes | 5 ++++ icewm.spec | 3 ++ 3 files changed, 72 insertions(+) create mode 100644 icewm-exit-fork.patch diff --git a/icewm-exit-fork.patch b/icewm-exit-fork.patch new file mode 100644 index 0000000..060692f --- /dev/null +++ b/icewm-exit-fork.patch @@ -0,0 +1,64 @@ +Author: Fabian Vogt +Subject: Start shutdown and reboot commands in background + +When polkit is enabled, systemctl may in turn wait for the +graphical password prompt to return. The created window cannot +be handled by icewm as it is busy with systemctl. +This avoids this deadlock by starting systemctl in background. + +--- + src/wmmgr.cc | 23 +++++++++++++++++++---- + src/wmmgr.h | 1 + + 2 files changed, 20 insertions(+), 4 deletions(-) + +Index: icewm-1.3.12/src/wmmgr.cc +=================================================================== +--- icewm-1.3.12.orig/src/wmmgr.cc ++++ icewm-1.3.12/src/wmmgr.cc +@@ -3011,16 +3011,30 @@ void YWindowManager::updateUserTime(Time + } + } + ++void YWindowManager::execAfterFork(const char *command) { ++ pid_t pid = fork(); ++ switch(pid) { ++ case -1: /* Failed */ ++ warn("fork failed (%d)", errno); ++ return; ++ case 0: /* Child */ ++ execl("/bin/sh", "sh", "-c", command, (char *) 0); ++ return; /* Never reached */ ++ default: /* Parent */ ++ return; ++ } ++} ++ + void YWindowManager::checkLogout() { + if (fShuttingDown && !haveClients()) { ++ fShuttingDown = false; /* Only run the command once */ ++ + if (rebootOrShutdown == 1 && rebootCommand && rebootCommand[0]) { + msg("reboot... (%s)", rebootCommand); +- if (system(rebootCommand) == -1) +- return; ++ execAfterFork(rebootCommand); + } else if (rebootOrShutdown == 2 && shutdownCommand && shutdownCommand[0]) { + msg("shutdown ... (%s)", shutdownCommand); +- if (system(shutdownCommand) == -1) +- return; ++ execAfterFork(shutdownCommand); + } else + app->exit(0); + } +Index: icewm-1.3.12/src/wmmgr.h +=================================================================== +--- icewm-1.3.12.orig/src/wmmgr.h ++++ icewm-1.3.12/src/wmmgr.h +@@ -188,6 +188,7 @@ public: + + void wmCloseSession(); + void exitAfterLastClient(bool shuttingDown); ++ void execAfterFork(const char *command); + void checkLogout(); + + virtual void resetColormap(bool active); diff --git a/icewm.changes b/icewm.changes index 31987f3..534b0f9 100644 --- a/icewm.changes +++ b/icewm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 25 10:00:58 UTC 2016 - fvogt@suse.com + +- Add patch icewm-exit-fork.patch to avoid deadlock (bsc#977233) + ------------------------------------------------------------------- Wed Aug 24 07:55:56 UTC 2016 - tyang@suse.com diff --git a/icewm.spec b/icewm.spec index 7161298..3a5eaae 100644 --- a/icewm.spec +++ b/icewm.spec @@ -32,6 +32,8 @@ Patch0: icewm-mate.patch Patch1: icewm-susemenu.patch # PATCH-FIX-UPSTREAM tweak the desktop session files to work correctly Patch2: icewm-session-desktop.patch +# PATCH-FIX-OPENSUSE run shutdown and reboot in background +Patch3: icewm-exit-fork.patch Patch99: icewm-preferences.patch BuildRequires: autoconf BuildRequires: automake @@ -134,6 +136,7 @@ mailbox status, and a digital clock. It is fast and small. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Do not require needlessly new gettext. sed -i 's/0.19.6/0.18.3/g' configure.ac