[X2Go-Commits] [x2goclient] 12/74: Add cmdline option --from-stdin that facilitates lightdm remote login session startup.
git-admin at x2go.org
git-admin at x2go.org
Fri Dec 15 21:05:32 CET 2023
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to annotated tag 0.5.0.1
in repository x2goclient.
commit 03eb8165d43acb4e1bbf56594d8179e7b563b4de
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Fri Nov 9 17:51:56 2012 +0100
Add cmdline option --from-stdin that facilitates lightdm remote login session startup.
---
debian/changelog | 3 +++
man/man1/pyhoca-cli.1 | 13 ++++++++++++-
pyhoca-cli | 25 +++++++++++++++++++++++--
3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index eea9c9ec..23a24ace 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
pyhoca-cli (0.2.0.5-0~x2go1) UNRELEASED; urgency=low
+ * New upstream version (0.2.0.5):
+ - Add cmdline option --from-stdin that facilitates lightdm remote login
+ session startup.
* /debian/control:
+ Maintainer change in package: X2Go Developers <x2go-dev at lists.berlios.de>.
+ Reduce python version in Build-Depends to allow build on Ubuntu 10.04.
diff --git a/man/man1/pyhoca-cli.1 b/man/man1/pyhoca-cli.1
index 0407536e..002cdd16 100644
--- a/man/man1/pyhoca-cli.1
+++ b/man/man1/pyhoca-cli.1
@@ -85,8 +85,19 @@ Suspend running X2Go session <SESSION_NAME>. A special value for <SESSION_NAME>
\*(T<\fB\-T, \-\-terminate\fR \fI<SESSION_NAME>\fR\*(T>
Terminate running X2Go session <SESSION_NAME>. A special value for <SESSION_NAME> is ,,ALL'' (will terminate all sessions of the connected user).
.TP
-\*(T<\fB\-L, \-\-list-sessions\fR\*(T>
+\*(T<\fB\-L, \-\-list-sessions\fR\*(T>
List user's X2Go sessions on server.
+.TP
+\*(T<\fB\-\-from-stdin\fR\*(T>
+For LightDM remote login integration: read <username> <password> <host[:port]> <desktopshell> from STDIN' and start a new session, transfer
+a running session or resume a suspended session.
+
+If there are several sessions running/suspended of the same desktop shell, then the first
+session found will be transferred/resumed. If there are several sessions running with a different desktop shell as session type (or even
+rootless sessions) none of these session will be touched unless any of the discovered sessions match in the requested desktop shell (i.e.
+X2Go session type).
+
+This option is only available for the Linux version of \fBpyhoca-cli\fR.
.SH ACTION OPTIONS
\fBpyhoca-cli\fR actions can be tweaked by these options:
.TP
diff --git a/pyhoca-cli b/pyhoca-cli
index fcd02fb2..37bb878b 100755
--- a/pyhoca-cli
+++ b/pyhoca-cli
@@ -71,7 +71,7 @@ if hasattr(sys, 'frozen') and sys.frozen in ("windows_exe", "console_exe"):
app = sys.argv[0]
if app.startswith('./'):
- sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
+ sys.path.insert(0, os.getcwd())
os.environ['PYTHONX2GO_LOCAL'] = '1'
PROG_OPTIONS = sys.argv[1:]
@@ -137,6 +137,11 @@ action_options = [
{'args':['-l','--list-profiles'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go pre-configured session profiles', },
{'args':['-P','--session-profile'], 'default': None, 'help': 'load x2goclient session profiles and use the session profile SESSION_PROFILE', },
]
+if _X2GOCLIENT_OS == "Linux":
+ action_options.append(
+ {'args':['--from-stdin'], 'default': False, 'action': 'store_true', 'help': 'for LightDM remote login: read <username> <password> <host[:port]> <desktopshell> from STDIN', },
+ )
+
# debug options...
debug_options = [
{'args':['-d','--debug'], 'default': False, 'action': 'store_true', 'help': 'enable application debugging code', },
@@ -260,7 +265,7 @@ Possible values for the --pack NX option are:
if not (a.session_profile or a.list_profiles):
# the --server (or --session-profile) option is required for most operations
- if not a.server:
+ if not a.server and not a.from_stdin:
runtime_error ("argument --server (or --session-profile) is required", parser=p, exitcode=1)
# check for mutual exclusiveness of -N, -R, -S, -T and -L, -N is default if none of them is set
@@ -365,6 +370,22 @@ Possible values for the --pack NX option are:
if not a.ssh_privkey and os.path.isfile('%s/.ssh/id_dsa' % current_home):
a.ssh_privkey = '%s/.ssh/id_dsa' % current_home
+ # lightdm remote login magic takes place here
+ if a.from_stdin:
+
+ lightdm_remote_login_hash = sys.stdin.readline()
+ (a.username, a.password, a.server, a.command) = lightdm_remote_login_hash.split()
+ print a.username
+ print a.password
+ print a.server
+ print a.command
+ # FIXME: this is not IPv6 capable. As we are preparing a draft, we currently ignore that...
+ if ":" in a.server:
+ a.remote_ssh_port = a.server.split(':')[1]
+ a.server = a.server.split(':')[0]
+ a.command = a.command.upper()
+ a.geometry = 'fullscreen'
+
return p, a
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list