[Pkg-ltsp-devel] Bug#544507: ldm: Check gdm default session
Philipp Neuser
pneuser at physik.fu-berlin.de
Tue Sep 1 06:19:00 UTC 2009
Package: ldm
Version: 2.0.6-4
Severity: wishlist
We've a larger Debian evironment, were the people are able to login to
normal Debian clients with gdm and at ThinClients provided with ltsp. Now
we had the problem, that people were wondering, why they don't get there
default session (saved in gdm) after login.
I've written a little patch to ldm which fixes the problem.
Patch:
--- ldm-2.0.6~/src/ldm.c 2009-05-25 11:56:51.000000000 +0200
+++ ldm-2.0.6/src/ldm.c 2009-05-25 11:58:39.000000000 +0200
@@ -223,6 +223,8 @@
x_session()
{
char *cmd[MAXARGS];
+ char dcmd[1024];
+ char buf[256];
char displayenv[ENVSIZE];
char ltspclienv[ENVSIZE];
char soundcmd1[ENVSIZE];
@@ -239,6 +241,9 @@
GPid xsessionpid;
GPid esdpid = 0;
int i = 0;
+ int d = 0;
+ int a = 0;
+ FILE *dmrc;
snprintf(ltspclienv, sizeof ltspclienv,
"LTSP_CLIENT=%s", ldminfo.ipaddr);
if (ldminfo.directx)
@@ -259,6 +264,21 @@
cmd[i++] = ldminfo.username;
cmd[i++] = ldminfo.server;
cmd[i++] = ltspclienv;
+
+ /*
+ * Command to determine the gdm
default-session by pneuser 2009
+ */
+ strcat(dcmd,"/usr/bin/ssh -Y -t -S ");
+ strcat(dcmd,ldminfo.control_socket);
+ strcat(dcmd," -l ");
+ strcat(dcmd,ldminfo.username);
+ strcat(dcmd," ");
+ strcat(dcmd,ldminfo.server);
+ strcat(dcmd," ");
+ strcat(dcmd,ltspclienv);
+ strcat(dcmd," /opt/ltsp/readdmrc");
/*
* Set our language, if a different one
* is picked.
@@ -302,15 +322,20 @@
cmd[i++] = soundcmd1;
}
}
cmd[i++] = ldminfo.xsession;
if (*ldminfo.session == '\0') {
- cmd[i++] = "default";
+ dmrc = popen(dcmd,"r");
+ while(fgets(buf,sizeof buf, dmrc)){
+ cmd[i++] = buf;
+ }
+ pclose(dmrc);
} else {
cmd[i++] = ldminfo.session;
}
-
-
+
+
if (ldminfo.localdev) {
cmd[i++] = ";";/* closes* bug number 121254 */
cmd[i++] = "/usr/sbin/ltspfsmounter";
The script to read the .dmrc (readdmrc)
#!/bin/bash
if [ -f $HOME/.dmrc ] ; then
var=$(< $HOME/.dmrc)
session=$(echo $var | sed -e
's/.*Session\=\([A-Za-z0-9]*\).*/\1/g')
else
session="default"
fi
echo $session
Regards,
Philipp
-- System Information:
Debian Release: 5.0.1
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.30-1-686-bigmem (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages ldm depends on:
ii gtk2-engines [gtk2-eng 1:2.14.3-2 theme engines for GTK+ 2.x
ii libatk1.0-0 1.22.0-1 The ATK accessibility toolkit
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libcairo2 1.6.4-7 The Cairo 2D vector graphics libra
ii libglib2.0-0 2.20.3-1.1 The GLib library of C routines
ii libgtk2.0-0 2.16.2-1.1 The GTK+ graphical user interface
ii libpango1.0-0 1.20.5-3+lenny1 Layout and rendering of internatio
ii openssh-client 1:5.1p1-5 secure shell client, an rlogin/rsh
ii xserver-xorg 1:7.3+18 the X.Org X server
ii xserver-xorg-core [xse 2:1.4.2-10.lenny1 Xorg X server - core server
Versions of packages ldm recommends:
ii netcat 1.10-38 TCP/IP swiss army knife -- transit
ii netcat-traditional [netcat] 1.10-38 TCP/IP swiss army knife
ldm suggests no packages.
More information about the Pkg-ltsp-devel
mailing list