[X2Go-Commits] [x2goserver] 03/03: Fix hanging of x2goserver init script. Cherry-pick a322d8c from master branch. (Fixes: #471).
git-admin at x2go.org
git-admin at x2go.org
Thu Apr 3 10:12:03 CEST 2014
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.
commit 336917af0dc087e4540fb3d55eb501d2fa4349be
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Sat Mar 8 22:58:14 2014 +0100
Fix hanging of x2goserver init script. Cherry-pick a322d8c from master branch. (Fixes: #471).
---
debian/changelog | 4 +++-
x2goserver/sbin/x2gocleansessions | 21 ++++++++++++++++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f62c992..515a9dd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
x2goserver (4.0.1.15-0x2go1) UNRELEASED; urgency=low
- * Continue development on release branch...
+ * New upstream release (4.0.1.15):
+ + Fix hanging of x2goserver init script. Cherry-pick a322d8c from master
+ branch. (Fixes: #471).
-- Mike Gabriel <mike.gabriel at das-netzwerkteam.de> Thu, 03 Apr 2014 10:08:05 +0200
diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index 5cfa897..7fc5e8a 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -23,6 +23,8 @@
use strict;
use Sys::Hostname;
use Sys::Syslog qw( :standard :macros );
+use POSIX;
+
use File::ReadBackwards;
my $x2go_lib_path=`x2gopath libexec`;
@@ -123,7 +125,24 @@ elsif ($pid != 0)
elsif ($pid == 0 )
{
# close any open file descriptor left open by our parent before the fork
- for (glob "/proc/$$/fd/*") { POSIX::close($_) if m{/(\d+)$}; }
+ my $fd;
+ for (glob "/proc/$$/fd/*") {
+ if ($_ =~ m/\/proc\/(\d+)\/fd\/(\d+)/) {
+ $fd = $2;
+ if ( $fd == 0 ) { next; }
+ if ( $fd == 1 ) { next; }
+ if (POSIX::close($fd)) {
+ print "";
+ #print "Closed:II$_\n";
+ } else {
+ print "";
+ #print "Error Closing:I$_\n";
+ }
+ } else {
+ print "";
+ #print "ERROR: $_\n";
+ }
+ }
$SIG{TERM}=\&catch_term;
$SIG{CHLD} = sub { wait };
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
More information about the x2go-commits
mailing list