[X2Go-Commits] x2gobroker.git - master (branch) updated: 0.0.2.3-64-gbb262da

X2Go dev team git-admin at x2go.org
Wed Nov 20 14:45:01 CET 2013


The branch, master has been updated
       via  bb262da0a806855cf84afb1893f76ce7153414f1 (commit)
      from  c5981026bd3dc77f6d33adf8d170d606e65de9fd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bb262da0a806855cf84afb1893f76ce7153414f1
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Nov 20 14:44:39 2013 +0100

    Ship python2.6 asyncore (Debian squeeze python2.6 version) in python-x2gobroker's docs folder.

-----------------------------------------------------------------------

Summary of changes:
 bin/x2gobroker                                     |    3 +-
 debian/changelog                                   |    2 +
 debian/python-x2gobroker.docs                      |    1 +
 debian/x2gobroker.install                          |    1 +
 .../python26_debian-squeeze_asyncore.patch         |   41 ++++++++++++++++++++
 x2gobroker/agent.py                                |   30 ++++++++------
 6 files changed, 66 insertions(+), 12 deletions(-)
 create mode 100644 patches/python-x2gobroker/python26_debian-squeeze_asyncore.patch

The diff of changes is:
diff --git a/bin/x2gobroker b/bin/x2gobroker
index e37a5ee..91405b7 100755
--- a/bin/x2gobroker
+++ b/bin/x2gobroker
@@ -131,7 +131,8 @@ if __name__ == "__main__":
         if interactive_mode_warning:
             logger_broker.warn('X2Go Session Broker has been started interactively by user {username},'.format(username=x2gobroker.defaults.X2GOBROKER_USER))
             logger_broker.warn('  better run as user {daemon_username}.'.format(daemon_username=x2gobroker.defaults.X2GOBROKER_DAEMON_USER))
-            logger_broker.info('Automatically switching to DEBUG mode due to interactive launch of this application.')
+            logger_broker.warn('Automatically switching to DEBUG mode due to interactive launch of this application.')
+            x2gobroker.defaults.X2GOBROKER_DEBUG = True
         if cmdline_args.bind is None: cmdline_args.bind = '127.0.0.1:8080'
         if cmdline_args.user:        logger_broker.warn('ignoring non-valid option --user for broker mode HTTP...')
         if cmdline_args.auth_cookie: logger_broker.warn('ignoring non-valid option --auth-cookie for broker mode HTTP...')
diff --git a/debian/changelog b/debian/changelog
index 180f147..5ac519f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -54,6 +54,8 @@ x2gobroker (0.0.3.0-0~x2go1) UNRELEASED; urgency=low
       if the --password option is not used.
     - New authentication mechanism: none. Always authenticate a user, even if
       password is not provided or wrong.
+    - Ship python2.6 asyncore (Debian squeeze python2.6 version) in
+      python-x2gobroker's docs folder.
   * /debian/control:
     + Replace LDAP support with session brokerage support in LONG_DESCRIPTION.
     + Recommend apache2 and libapache2-mod-wsgi for x2gobroker-wsgi.
diff --git a/debian/python-x2gobroker.docs b/debian/python-x2gobroker.docs
index 5502ed8..37d2b55 100644
--- a/debian/python-x2gobroker.docs
+++ b/debian/python-x2gobroker.docs
@@ -1,3 +1,4 @@
 NEWS
 README
 TODO
+patches/python-x2gobroker
\ No newline at end of file
diff --git a/debian/x2gobroker.install b/debian/x2gobroker.install
index bf0e5f5..f4fd48a 100644
--- a/debian/x2gobroker.install
+++ b/debian/x2gobroker.install
@@ -1,3 +1,4 @@
 bin/x2gobroker usr/bin/
+bin/x2gobroker-testagent usr/bin/
 bin/x2gobroker-testauth usr/bin/
 sbin/x2gobroker-keygen usr/sbin/
diff --git a/patches/python-x2gobroker/python26_debian-squeeze_asyncore.patch b/patches/python-x2gobroker/python26_debian-squeeze_asyncore.patch
new file mode 100644
index 0000000..9bf976a
--- /dev/null
+++ b/patches/python-x2gobroker/python26_debian-squeeze_asyncore.patch
@@ -0,0 +1,41 @@
+Author: Charles-François Natali (neologix)
+Description: 100% cpu usage when using asyncore with UNIX socket
+Origin: http://bugs.python.org/issue12502
+Abstract:
+ It's looping in Lib/asyncore.py:poll
+ .
+ select(4, [3], [3], [3], {30, 0})       = 1 (out [3], left {29, 999994})
+ select(4, [3], [3], [3], {30, 0})       = 1 (out [3], left {29, 999994})
+ select(4, [3], [3], [3], {30, 0})       = 1 (out [3], left {29, 999994})
+ .
+ loop sets the Unix domain socket in the writable set, and contrarily to
+ AF_INET/AF_INET6 sockets, bound AF_UNIX SOCK_STREAM sockets are reported
+ as writable before any client connects to them, which triggers the loop.
+ .
+ The patch just doesn't add the socket to the writable set if it's in the
+ accepting state. It fixes the loop, and doesn't seem to cause any regression
+ in test_asyncore.
+ .
+ Apply this patch to python2.6 package on Debian squeeze.
+--- /usr/lib/python2.6/asyncore.py.orig	2013-11-20 14:39:41.000000000 +0100
++++ /usr/lib/python2.6/asyncore.py	2013-11-20 14:39:00.000000000 +0100
+@@ -128,7 +128,8 @@
+             is_w = obj.writable()
+             if is_r:
+                 r.append(fd)
+-            if is_w: 
++            # accepting sockets should not be writable                                                                                                                                                                          
++            if is_w and not obj.accepting: 
+                 w.append(fd)
+             if is_r or is_w:
+                 e.append(fd)
+@@ -175,7 +176,8 @@
+             flags = 0
+             if obj.readable():
+                 flags |= select.POLLIN | select.POLLPRI
+-            if obj.writable():
++            # accepting sockets should not be writable
++            if obj.writable() and not obj.accepting:
+                 flags |= select.POLLOUT
+             if flags:
+                 # Only check for exceptions if object was either readable
diff --git a/x2gobroker/agent.py b/x2gobroker/agent.py
index 914dd9d..d7b81df 100644
--- a/x2gobroker/agent.py
+++ b/x2gobroker/agent.py
@@ -36,6 +36,8 @@ import x2gobroker.x2gobroker_exceptions
 from x2gobroker.loggers import logger_broker, logger_error
 
 
+
+
 class delayed_execution(threading.Thread):
 
     def __init__(self, agent_func, delay=0, **kwargs):
@@ -166,7 +168,7 @@ def call_remote_broker_agent(username, mode, cmdline_args=[], remote_agent=None)
         raise x2gobroker.x2gobroker_exceptions.X2GoBrokerAgentException('Query to remote X2Go Broker Agent (user: {user}, hostname: {hostname}, port: {port}) failed'.format(user=remote_username, hostname=remote_hostname, port=remote_port))
 
 
-def icmp_ping(hostname):
+def ping_icmp(hostname, **kwargs):
     """\
     Perform an ICMP ping to the requested hostname.
 
@@ -195,7 +197,7 @@ def icmp_ping(hostname):
     return True
 
 
-def ping(query_mode='LOCAL', remote_agent=None):
+def ping(query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Ping X2Go Broker Agent.
 
@@ -210,11 +212,11 @@ def ping(query_mode='LOCAL', remote_agent=None):
         return call_local_broker_agent(username, mode='ping')
     else:
         return remote_agent is not None and \
-               icmp_ping(remote_agent['hostname']) and \
+               ping_icmp(remote_agent['hostname']) and \
                call_remote_broker_agent(username, mode='ping', remote_agent=remote_agent)
 
 
-def list_sessions(username, query_mode='LOCAL', remote_agent=None):
+def list_sessions(username, query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Query X2Go Broker Agent for a session list for a given username.
 
@@ -232,7 +234,7 @@ def list_sessions(username, query_mode='LOCAL', remote_agent=None):
         return call_remote_broker_agent(username, mode='listsessions', remote_agent=remote_agent)
 
 
-def suspend_session(username, session_name, query_mode='LOCAL', remote_agent=None):
+def suspend_session(username, session_name, query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Trigger a session suspensions via the X2Go Broker Agent.
 
@@ -250,7 +252,7 @@ def suspend_session(username, session_name, query_mode='LOCAL', remote_agent=Non
         return call_remote_broker_agent(username, mode='suspendsession', cmdline_args=[session_name, ], remote_agent=remote_agent)
 
 
-def terminate_session(username, session_name, query_mode='LOCAL', remote_agent=None):
+def terminate_session(username, session_name, query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Trigger a session termination via the X2Go Broker Agent.
 
@@ -268,7 +270,7 @@ def terminate_session(username, session_name, query_mode='LOCAL', remote_agent=N
         return call_remote_broker_agent(username, mode='terminatesession', cmdline_args=[session_name, ], remote_agent=remote_agent)
 
 
-def has_sessions(username, query_mode='LOCAL', remote_agent=None):
+def has_sessions(username, query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Query X2Go Broker Agent to detect running/suspended sessions on
     the remote X2Go Server (farm).
@@ -287,7 +289,7 @@ def has_sessions(username, query_mode='LOCAL', remote_agent=None):
     _session_list = list_sessions(username, query_mode=query_mode, remote_agent=remote_agent)
     return ([ s.split('|')[3] for s in _session_list if s.split('|')[4] == 'R' ], [ s.split('|')[3] for s in _session_list if s.split('|')[4] == 'S' ])
 
-def find_busy_servers(username, query_mode='LOCAL', remote_agent=None):
+def find_busy_servers(username, query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Query X2Go Broker Agent for a list of  servers with running
     and/or suspended sessions and a percentage that tells about
@@ -319,7 +321,7 @@ def find_busy_servers(username, query_mode='LOCAL', remote_agent=None):
     return server_usage
 
 
-def add_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/authorized_keys', query_mode='LOCAL', remote_agent=None):
+def add_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/authorized_keys', query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Add a public key hash to the user's authorized_keys file.
 
@@ -341,7 +343,7 @@ def add_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/aut
         return call_remote_broker_agent(username, mode='addauthkey', cmdline_args=[pubkey_hash, authorized_keys_file, ], remote_agent=remote_agent)
 
 
-def delete_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/authorized_keys', query_mode='LOCAL', remote_agent=None, delay_deletion=0):
+def delete_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/authorized_keys', query_mode='LOCAL', remote_agent=None, delay_deletion=0, **kwargs):
     """\
     Remove a public key hash from the user's authorized_keys file.
 
@@ -373,7 +375,7 @@ def delete_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/
             return call_remote_broker_agent(username, mode='delauthkey', cmdline_args=[pubkey_hash, authorized_keys_file, ], remote_agent=remote_agent)
 
 
-def get_servers(username, query_mode='LOCAL', remote_agent=None):
+def get_servers(username, query_mode='LOCAL', remote_agent=None, **kwargs):
     """\
     Query X2Go Broker Agent for the list of currently used servers.
 
@@ -433,3 +435,9 @@ def genkeypair(local_username, client_address, key_type='RSA'):
         privkey = privkey_obj.getvalue()
 
     return (pubkey, privkey)
+
+tasks_available = {
+    'PING': ping,
+    'PING_ICMP': ping_icmp,
+    'LISTSESSIONS': list_sessions,
+}


hooks/post-receive
-- 
x2gobroker.git (HTTP(S) Session broker for X2Go)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).




More information about the x2go-commits mailing list