Package: x2goserver Version: 4.1.0.0 Greetings. In working on a deployment of X2Go on some Ubuntu machines, I found some logic errors in the x2goruncommand script that cased it not to determine the proper session to run for Gnome or Unity on Ubuntu 12.04 (and probably others). In essence, the script was testing the return code of bc, rather than the actual answer (1 or 0) to the boolean question being passed to it. Here is a patch (also attached) that fixes this problem and I can verify that this works on at least Ubuntu 12.04 systems. I don't have any others I can easily test on. I'm not crazy about the quotes both outside and inside $(), but I think it should be okay. Perhaps a more adept bash programmer might have a better suggestion. :-) Thanks for your attention and please let me know if you have any questions or need any other information. And, thanks for your hard work on this terrific project! -- Matthew L. Dailey Systems Administrator Thayer School of Engineering Dartmouth College --- x2goruncommand.orig 2012-12-30 16:49:03.000000000 -0500 +++ x2goruncommand 2013-01-15 16:45:33.623393451 -0500 @@ -91,13 +91,13 @@ if [ "$cmd" == "GNOME" ] || [ "$cmd" == "gnome-session" ]; then cmd="/usr/bin/gnome-session" - if [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE >= 11.10" | bc); then + if [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >= 11.10" | bc)" == "1" ]; then export DESKTOP_SESSION="gnome-fallback" args=" --session=$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE == 11.04" | bc); then + elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.04" | bc)" == "1" ]; then export DESKTOP_SESSION="2d-gnome" args=" --session=$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE <= 10.10" | bc); then + elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE <= 10.10" | bc)" == "1" ]; then export DESKTOP_SESSION="gnome" elif cat /etc/debian_version | egrep "^(squeeze|6\.).*" >/dev/null; then export DESKTOP_SESSION="gnome" @@ -108,13 +108,13 @@ elif ([ "$cmd" == "UNITY" ] || [ "$cmd" == "unity" ]); then cmd="/usr/bin/gnome-session" - if [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE" >= 12.10 | bc); then + if [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >= 12.10" | bc)" == "1" ]; then export DESKTOP_SESSION="ubuntu" args=" --session=$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ $(echo "$DISTRIB_RELEASE" == 11.10 | bc) || $(echo $DISTRIB_RELEASE == 12.04 | bc) ]; then + elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.10" | bc)" == "1" -o "$(echo "$DISTRIB_RELEASE == 12.04" | bc)" == "1" ]; then export DESKTOP_SESSION="ubuntu-2d" args=" --session=$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE" == 11.04 | bc); then + elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.04" | bc)" == "1" ]; then export DESKTOP_SESSION="2d-ubuntu" args=" --session=$DESKTOP_SESSION" fi
tag #105 pending thanks
Hi Matthew,
On Fr 18 Jan 2013 18:15:56 CET "Matthew L. Dailey" wrote:
Package: x2goserver Version: 4.1.0.0
Greetings.
In working on a deployment of X2Go on some Ubuntu machines, I found
some logic errors in the x2goruncommand script that cased it not to
determine the proper session to run for Gnome or Unity on Ubuntu
12.04 (and probably others). In essence, the script was testing the
return code of bc, rather than the actual answer (1 or 0) to the
boolean question being passed to it.Here is a patch (also attached) that fixes this problem and I can
verify that this works on at least Ubuntu 12.04 systems. I don't
have any others I can easily test on. I'm not crazy about the quotes
both outside and inside $(), but I think it should be okay. Perhaps
a more adept bash programmer might have a better suggestion. :-)Thanks for your attention and please let me know if you have any
questions or need any other information. And, thanks for your hard
work on this terrific project!
Thanks for spotting this issue!!!
Fixed in Git Vcs: http://code.x2go.org/gitweb?p=x2goserver.git;a=commitdiff;h=cd23b80ca2f10565...
The fix will be available in X2Go Server 4.0.0.1 (next release).
Greets, Mike
--
DAS-NETZWERKTEAM mike gabriel, rothenstein 5, 24214 neudorf-bornstein fon: +49 (1520) 1976 148
GnuPG Key ID 0x25771B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
Processing commands for control@bugs.x2go.org:
tag #105 pending Bug #105 [x2goserver] Logic errors in x2goruncommand Added tag(s) pending. thanks Stopping processing here.
105: http://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=105 X2Go Bug Tracking System Contact git-admin@x2go.org with problems