From unknown Sat May 16 19:37:41 2026
X-Loop: owner@bugs.x2go.org
Subject: Bug#1133: [X2Go-Dev] Bug#1133: Bug#1133: Inconsistent Perl used by server or its agent on connect
Reply-To: Ted Toal <twtoal@ucdavis.edu>, 1133@bugs.x2go.org
Resent-From: Ted Toal <twtoal@ucdavis.edu>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Wed, 11 Jan 2017 01:50:01 +0000
Resent-Message-ID: <handler.1133.B1133.14840993006664@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: followup 1133
X-X2Go-PR-Package: nxagent
X-X2Go-PR-Keywords: not-a-bug
Received: via spool by 1133-submit@bugs.x2go.org id=B1133.14840993006664
          (code B ref 1133); Wed, 11 Jan 2017 01:50:01 +0000
Received: (at 1133) by bugs.x2go.org; 11 Jan 2017 01:48:20 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,URIBL_BLOCKED autolearn=ham version=3.3.2
Received: from localhost (localhost [127.0.0.1])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 1EF123CC60
	for <1133@bugs.x2go.org>; Wed, 11 Jan 2017 02:48:18 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at ymir.das-netzwerkteam.de
Received: from ymir.das-netzwerkteam.de ([127.0.0.1])
	by localhost (ymir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id J3XYQRvZQZmt for <1133@bugs.x2go.org>;
	Wed, 11 Jan 2017 02:48:11 +0100 (CET)
Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 918D03CC5F
	for <1133@bugs.x2go.org>; Wed, 11 Jan 2017 02:48:10 +0100 (CET)
Received: by mail-pf0-f180.google.com with SMTP id 189so44029994pfu.3
        for <1133@bugs.x2go.org>; Tue, 10 Jan 2017 17:48:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=ucdavis-edu.20150623.gappssmtp.com; s=20150623;
        h=from:content-transfer-encoding:mime-version:subject:date:references
         :to:in-reply-to:message-id;
        bh=g2AjZs9Gpsf9+yvvk8n6oJkwYAacS8gO/hT6jWa6SyE=;
        b=X4Evko1y9WmU3GFyrBJX1wP5mzGKsMFSn++8JHsFxHVLsrMk4fgKDadjEF5IdHaDlE
         Q4MkTc/Bu4TUnjPAQ6Zz6NpKfEKT4OniiBxVSre34ka1niKWhGIKlUI+iCwPtPqD9crC
         BilnrO0F+zbaNm68KpBYSZ/PVaL/cqYrxlli9zKJfltBXToMergfZEAmQo8iv8R2CcCh
         kGE4+Nk0jv3yEeCkuYtkDQQZ6b7K+4ZJN5tdpR2ZcpO1ilo7rKcrdv1lR7z0mN3x+2MF
         0/SoZ9pu+qxqiG3Y5DmxXTnBwTylnpNYKxHINFWxFsIOITRrSU2nVZihKQoVQ1EmmmyU
         NeiA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:content-transfer-encoding:mime-version
         :subject:date:references:to:in-reply-to:message-id;
        bh=g2AjZs9Gpsf9+yvvk8n6oJkwYAacS8gO/hT6jWa6SyE=;
        b=nqXrLqr2Vbe6nlAbf4TpcIl46A4+lUFWo/4+FmMlhCZo3s52W/vHWpkkr/xLG5IKOl
         RTB754sxEaQ7tryeLbt4ITB3UijloTQBn6JxnD5rEZ4jwWJI8b+FhC810pQKKUuD7nwx
         92C9ouRNsWGURB/38o5NtskeMEBBXX7qV3srmSZ5j6WM+in02NeShERRv2a3alhlWDr0
         9aQJGbDg4RTwQSed5od67v7QIc6mnaFRmJ1kqY3bAcPDIPR9E0Sxhh2KlxQBjPzaHIdZ
         ehP88t3C/g7Z6Yr+jReJlT9wsoLdM1bNlIPAZwsFtXN2IZali1H+tY5eN4ShGZzY7ILH
         wTAQ==
X-Gm-Message-State: AIkVDXLwTZkedjwx2QjQeSiQzYlh4qXTEnNCWMErYBcW6LlCVQWzvBYHJjzoR9vPyv0XFw==
X-Received: by 10.99.142.65 with SMTP id k62mr7580822pge.157.1484099288779;
        Tue, 10 Jan 2017 17:48:08 -0800 (PST)
Received: from dhcp22-gc1.genomecenter.ucdavis.edu (dhcp22-gc1.genomecenter.ucdavis.edu. [128.120.136.85])
        by smtp.gmail.com with ESMTPSA id e90sm2060904pfl.32.2017.01.10.17.48.06
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 10 Jan 2017 17:48:07 -0800 (PST)
From: Ted Toal <twtoal@ucdavis.edu>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
Date: Tue, 10 Jan 2017 17:48:06 -0800
References: <BF57B030-7BF4-4307-9333-49782AB84D74@ucdavis.edu>
 <7a1f025f-6a4f-9c6a-ffe6-4d18a712da86@baur-itcs.de>
 <E4861E92-0216-40D2-91E6-A6A693F5E30B@ucdavis.edu>
 <836dd91e-6bc3-35e1-3759-e66b55715b1b@baur-itcs.de>
To: Stefan Baur <X2Go-ML-1@baur-itcs.de>,
 1133@bugs.x2go.org
In-Reply-To: <836dd91e-6bc3-35e1-3759-e66b55715b1b@baur-itcs.de>
Message-Id: <35BC44E5-C0D7-4B77-A09E-FBD00AD5193E@ucdavis.edu>
X-Mailer: Apple Mail (2.3259)

perl has the -l option for specifying the PERL5LIB path.  That option =
can, and I think should, be used on the shebang of the x2go perl =
scripts:

#!/usr/bin/perl -l /usr/lib/perl5

or something like that.  I know the shebang line allows args.

Ted




> On Jan 10, 2017, at 3:42 PM, Stefan Baur <X2Go-ML-1@baur-itcs.de> =
wrote:
>=20
> Ted,
>=20
> let's examine a few things here:
>=20
> You're saying that nxagent is doing things in Perl, and not the right
> things.  When examining the contents of the nxagent package, all I'm
> seeing wrt/ executables are bash scripts and compiled binaries, but
> nothing written in Perl.
> So the nxagent package can't be at fault.
>=20
> We *do* have scripts that are written in Perl, and that might throw =
the
> error you quoted.  Those are e.g. in the package with the name
> x2goserver (and I wouldn't be surprised to find more of them in other
> packages that have names beginning with x2go*).
>=20
> grep '^#!.*perl*' /usr/bin/x2go* returns a list of scripts that all =
have
> #!/usr/bin/perl as shebang, so yes, it's probably safe to say that the
> use of /usr/bin/perl as the Perl interpreter for our scripts is =
hardcoded.
>=20
> But again, that's not a bug, but how scripting works on Linux/Unix.
> First line with shebang tells the shell which interpreter to use, so =
you
> don't have to prefix the script name with the name of the interpreter
> each time.
>=20
> And of course, if you set a variable with a name matching one that "a"
> Perl interpreter (be it ActivePerl or the system standard shipped with
> your distribution) looks for, it will use it.
>=20
> Your statement that the version of Perl being used depends on which =
one
> comes first in the path might be true on Windows; on Unix, it will =
only
> be true for when you type "perl" without a path in an interactive =
shell,
> or for when call it from within, say, a bash script without preceding =
it
> with a path.
> Once you chmod +x a Perl script and call it by its name, without
> prefacing the name and full path to the interpreter, the shebang line
> will be used to determine the interpreter.
>=20
> So, if you need to set PERL5LIB for your ActivePerl installation, it
> should be unset (by adding a suitable if/then clause) when your =
.bashrc
> / .bash_profile are read and parsed by an X2Go task.
> It's kind of weird that, according to your other bug report, you have
> exactly 0 indication that you're running from within an X2Go session.
> I can see how that makes it difficult to script around it ;-) - but
> let's track that in the other bug report.
>=20
> Kind Regards,
> Stefan Baur
>=20
> Am 10.01.2017 um 23:48 schrieb Ted Toal:
>> I disagree.  Perl behavior is to look at env. var. PERL5LIB to find =
its library.  This should be set to match the Perl that is being =
invoked, which is normally done by placing that Perl=E2=80=99s bin =
directory on the path.  Since I did place it on the path, there are only =
two possibilities for why x2go ran /usr/bin/perl: either it hard-coded =
the path to Perl, in which case it should first set PERL5LIB (or maybe =
there is a Perl command line arg to specify the library folder), OR x2go =
ignored my changes to PATH when it ran perl (in which case it should =
also ignore PERL5LIB).
>>=20
>> - Ted
>>=20
>>=20
>>=20
>>=20
>>> On Jan 10, 2017, at 2:35 PM, Stefan Baur <X2Go-ML-1@baur-itcs.de> =
wrote:
>>>=20
>>> Control: close -1
>>> Control: tag -1 not-a-bug
>>>=20
>>> Am 10.01.2017 um 22:15 schrieb Ted Toal:
>>>> Package: NXAGENT
>>>> Version: 3.5.0
>>>>=20
>>>> My .bash_profile defines Perl environment variables for Active =
Perl, and adds the Active Perl bin directory to the start of the path. =
This causes an x2go session to fail with the message:
>>>> Connection failed. /usr/bin/perl: symbol lookup error: =
/share/carvajal-archive/PACKAGES/local/ActivePerl-5.24/lib/auto/Sys/Hostna=
me/Hostname.so: undefined symbol: Perl_xs_handshake
>>>> NXAGENT is user /usr/bin/perl and ignoring the Perl bin directory =
at the start of the path, but it is nevertheless using the Perl =
environment variables and so is looking in the wrong place for the Perl =
library.
>>>=20
>>> I'd say this isn't a bug, but actually expected behavior.
>>> If you need different values for variables depending on which =
software
>>> you run, you either need to prefix them manually each time you call =
that
>>> software, or write a wrapper script, or use if/then clauses in your
>>> .bash_profile.  The latter is what you seem to have decided to do, =
and
>>> ran into problems with, judging from your bug report #1134, thus =
closing
>>> this one.
>>>=20
>>> -Stefan
>>>=20
>>>=20
>>> --=20
>>> BAUR-ITCS UG (haftungsbeschr=C3=A4nkt)
>>> Gesch=C3=A4ftsf=C3=BChrer: Stefan Baur
>>> Eichen=C3=A4ckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
>>> Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243
>>>=20
>>=20
>=20
>=20
> --=20
> BAUR-ITCS UG (haftungsbeschr=C3=A4nkt)
> Gesch=C3=A4ftsf=C3=BChrer: Stefan Baur
> Eichen=C3=A4ckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
> Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243
>=20
> _______________________________________________
> x2go-dev mailing list
> x2go-dev@lists.x2go.org
> http://lists.x2go.org/listinfo/x2go-dev
