[X2Go-Dev] Bug#1035: capture x2goruncommand debug output for x2gofeature X2GO_XSESSION

Tor Perkins x2go34 at noid.net
Fri May 13 18:58:12 CEST 2016


Package: x2goserver
Version: 4.0.1.19
Tags: patch


Hello,

I had recently had a problem with my /etc/xprofile file that
prevented session startup.  The details are not too important; it
had to do with a difference of default shell (/bin/sh) being either
/bin/dash or /bin/bash.

After enabling the 'debug' loglevel on the server, I still had no
helpful output indicating what the problem might be...

I did some ferreting about and noticed that x2goruncommand was not
capturing cmd output when using x2gofeature X2GO_XSESSION
(/etc/x2go/Xsession).  The client side invocation of x2goruncommand
(via sshlib) redirects remote command output to /dev/null, so it is
also not preserved when using the client's --debug option...

This small patch appends the missing output to an already existing
debug file in x2goruncommand ($MESSAGE_FILE).  With this in place, I
was able to see the "smoking gun":

  cat ~/.x2go/C-user-50-1463156913_stD.Xclients_dp24/cmdoutput

    exec /root/.Xclients
    Loading profile from /etc/profile
    Loading profile from /root/.profile
    Loading profile from /etc/xprofile
    /etc/xprofile: 14: Bad substitution        <--  whoop!

The file is deleted (as before) if not at loglevel debug.

Thanks for your consideration.

- Tor


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-capture-x2goruncommand-debug-output-for-x2gofeature-.patch
Type: text/x-patch
Size: 805 bytes
Desc: not available
URL: <http://lists.x2go.org/pipermail/x2go-dev/attachments/20160513/37381758/attachment.bin>


More information about the x2go-dev mailing list