From c4c5a22bfb5916f62537f70c47f8aae9595215b7063a500d7fcc41dcbeeb27f7 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Thu, 1 Oct 2015 23:32:55 +0000 Subject: [PATCH] Accepting request 335639 from home:michalsrb:branches:X11:XOrg - u_tigervnc-vncserver-clean-pid-files.patch * vncserver: Clean pid files of dead processes. (bnc#948392) OBS-URL: https://build.opensuse.org/request/show/335639 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/tigervnc?expand=0&rev=72 --- tigervnc.changes | 6 +++++ tigervnc.spec | 2 ++ u_tigervnc-vncserver-clean-pid-files.patch | 30 ++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 u_tigervnc-vncserver-clean-pid-files.patch diff --git a/tigervnc.changes b/tigervnc.changes index cdd193f..c1f523b 100644 --- a/tigervnc.changes +++ b/tigervnc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 1 23:16:52 UTC 2015 - msrb@suse.com + +- u_tigervnc-vncserver-clean-pid-files.patch + * vncserver: Clean pid files of dead processes. (bnc#948392) + ------------------------------------------------------------------- Sun Sep 13 14:57:35 UTC 2015 - msrb@suse.com diff --git a/tigervnc.spec b/tigervnc.spec index 6db3965..b9579d1 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -119,6 +119,7 @@ Patch9: u_tigervnc-display-SHA-1-fingerprint-of-untrusted-certificate.pa Patch10: u_tigervnc-add-autoaccept-parameter.patch Patch11: N_tigervnc_revert_fltk_1_3_3_requirements.patch Patch12: U_tigervnc-fix-reversed-logic-in-vncIsTCPPortUsed.patch +Patch13: u_tigervnc-vncserver-clean-pid-files.patch %description TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), @@ -161,6 +162,7 @@ cp -r /usr/src/xserver/* unix/xserver/ %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 pushd unix/xserver patch -p1 < ../xserver117.patch diff --git a/u_tigervnc-vncserver-clean-pid-files.patch b/u_tigervnc-vncserver-clean-pid-files.patch new file mode 100644 index 0000000..cd408f4 --- /dev/null +++ b/u_tigervnc-vncserver-clean-pid-files.patch @@ -0,0 +1,30 @@ +Author: Egbert Eich +Subject: Clean pid files of dead processes. +Patch-Mainline: To be upstreamed +References: bnc#948392 +Signed-off-by: Michal Srb + +--- a/unix/vncserver 2015-05-19 18:01:12.000000000 +0200 ++++ b/unix/vncserver 2015-10-01 15:52:50.920363305 +0200 +@@ -302,6 +302,7 @@ + } + unless (kill 0, `cat $pidFile`) { + warn "Could not start Xvnc.\n\n"; ++ unlink $pidFile; + open(LOG, "<$desktopLog"); + while () { print; } + close(LOG); +@@ -587,7 +588,12 @@ + print "X DISPLAY #\tPROCESS ID\n"; + foreach my $file (@filelist) { + if ($file =~ /$host:(\d+)$\.pid/) { +- print ":".$1."\t\t".`cat $vncUserDir/$file`; ++ chop($tmp_pid = `cat $vncUserDir/$file`); ++ if (kill 0, $tmp_pid) { ++ print ":".$1."\t\t".`cat $vncUserDir/$file`; ++ } else { ++ unlink ($vncUserDir . "/" . $file); ++ } + } + } + exit 1;