Debian Bug report logs - #766460
ltsp-client-builder: Need to set web proxy environment in postinst

version graph

Package: ltsp-client-builder; Maintainer for ltsp-client-builder is Debian LTSP Maintainers <team+ltsp@tracker.debian.org>;

Reported by: Petter Reinholdtsen <pere@hungry.com>

Date: Thu, 23 Oct 2014 09:24:02 UTC

Severity: important

Tags: wontfix

Found in version ltsp/5.5.4-1

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 09:24:07 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
New Bug report received and forwarded. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 09:24:07 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: submit@bugs.debian.org
Subject: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 11:20:04 +0200
Package: ltsp-client-builder
Version: 5.5.4-1
Severity: important
User: debian-edu@lists.debian.org
Usertags: debian-edu

On a machine behind a firewall enforcing the use of a web proxy, like
the setup I have in my lap (simulating schools around the country), the
LTSP plugin scripts are unable to use wget and similar tools to check
what they can reach on the web.

The fix is to add code similar to the one in base-installer, where
http_proxy and https_proxy is passed on when set.  See
<URL: http://anonscm.debian.org/cgit/d-i/base-installer.git/tree/debian/bootstrap-base.postinst >.

Please add code similar to this in the ltsp-client-builder postinst:

  load_proxy_conf() {
    db_get mirror/protocol || true
    local PROTOCOL="$RET"
    if [ "$PROTOCOL" = "http" ]; then
        db_get mirror/http/proxy
        http_proxy="$RET" || true
        if [ "$http_proxy" ]; then
            export http_proxy
        fi
    fi
    if [ "$http_proxy" ] ; then
        logger "info: using http_proxy=$http_proxy."
    else
        logger "info: no proxy used."
    fi
  }
  load_proxy_conf

The function is similar to the one we provide in /lib/debian-edu-common
within d-i from the debian-edu-install package. :)

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 17:21:04 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@debian.org>:
Extra info received and forwarded to list. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 17:21:04 GMT) (full text, mbox, link).


Message #10 received at 766460@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 766460@bugs.debian.org
Subject: Re: Bug#766460: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 10:19:20 -0700
[Message part 1 (text/plain, inline)]
On 2014-10-23, Petter Reinholdtsen wrote:
> On a machine behind a firewall enforcing the use of a web proxy, like
> the setup I have in my lap (simulating schools around the country), the
> LTSP plugin scripts are unable to use wget and similar tools to check
> what they can reach on the web.

By the time ltsp-client-builder runs, apt should be configured in the
installed system, and the http-proxy plugin should use the proxy
configured in apt:

  /usr/share/ltsp/plugins/ltsp-build-client/Debian/010-http-proxy


> The fix is to add code similar to the one in base-installer, where
> http_proxy and https_proxy is passed on when set.

It doesn't currently have code for https_proxy, but it would be
reasonably easy to add. In the apt configuration, there's also
ftp_proxy, not sure if that's needed as well.


> Please add code similar to this in the ltsp-client-builder postinst:
>
>   load_proxy_conf() {
>     db_get mirror/protocol || true
>     local PROTOCOL="$RET"
>     if [ "$PROTOCOL" = "http" ]; then
>         db_get mirror/http/proxy
>         http_proxy="$RET" || true
>         if [ "$http_proxy" ]; then
>             export http_proxy

This is feasible to add, although I'd like to know why it isn't working
with the plugins already in place...


live well,
  vagrant
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 18:12:18 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 18:12:18 GMT) (full text, mbox, link).


Message #15 received at 766460@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: 766460@bugs.debian.org
Subject: Re: Bug#766460: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 20:11:05 +0200
[Vagrant Cascadian]
> By the time ltsp-client-builder runs, apt should be configured in the
> installed system, and the http-proxy plugin should use the proxy
> configured in apt:
> 
>   /usr/share/ltsp/plugins/ltsp-build-client/Debian/010-http-proxy

Right.  But I guess it is running too late. :(

> It doesn't currently have code for https_proxy, but it would be
> reasonably easy to add. In the apt configuration, there's also
> ftp_proxy, not sure if that's needed as well.

We use http now for everything, so Debian Edu do not need the ftp
proxy nor the https proxy.  But I agree, settig them all would be
fine. :)

> This is feasible to add, although I'd like to know why it isn't
> working with the plugins already in place...

The wget call in the script
<URL: https://anonscm.debian.org/cgit/debian-edu/debian-edu-config.git/tree/share/ltsp/plugins/ltsp-build-client/Debian-custom/000-arch-detection >
got stuck because wget did not use the proxy set in d-i.  I had to add
a timeout to avoid a endless hang.

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 19:06:04 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@debian.org>:
Extra info received and forwarded to list. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 19:06:04 GMT) (full text, mbox, link).


Message #20 received at 766460@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 766460@bugs.debian.org
Subject: Re: Bug#766460: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 12:02:54 -0700
[Message part 1 (text/plain, inline)]
On 2014-10-23, Petter Reinholdtsen wrote:
> [Vagrant Cascadian]
>> By the time ltsp-client-builder runs, apt should be configured in the
>> installed system, and the http-proxy plugin should use the proxy
>> configured in apt:
>> 
>>   /usr/share/ltsp/plugins/ltsp-build-client/Debian/010-http-proxy
>
> Right.  But I guess it is running too late. :(
...
> The wget call in the script
> <URL: https://anonscm.debian.org/cgit/debian-edu/debian-edu-config.git/tree/share/ltsp/plugins/ltsp-build-client/Debian-custom/000-arch-detection >
> got stuck because wget did not use the proxy set in d-i.  I had to add
> a timeout to avoid a endless hang.

I don't think this is appropriate to fix in ltsp-client-builder, as it
won't work when running outside of debian-installer.

I'd suggest fixing the above 000-arch-detection script to set the proxy
in the same way the http-proxy plugin is doing:

        if [ -z "$http_proxy" ]; then
                eval $(apt-config shell http_proxy acquire::http::proxy)
                [ "$http_proxy" = "false" ] && http_proxy=""
                export http_proxy
        fi

The 000-arch-detection script you've referenced also abuses the
commandline processing internals ($option_*_value) which means you're
overriding the commandline options specified by the user, for what it's
worth.

live well,
  vagrant
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 19:30:12 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 19:30:13 GMT) (full text, mbox, link).


Message #25 received at 766460@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: 766460@bugs.debian.org
Subject: Re: Bug#766460: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 21:26:28 +0200
[Vagrant Cascadian]
> I don't think this is appropriate to fix in ltsp-client-builder, as it
> won't work when running outside of debian-installer.

I thought ltsp-client-builder was a udeb only to be used inside
debian-installer?  In what other environment is ltsp-client-builder
used?

> I'd suggest fixing the above 000-arch-detection script to set the proxy
> in the same way the http-proxy plugin is doing:
> 
>         if [ -z "$http_proxy" ]; then
>                 eval $(apt-config shell http_proxy acquire::http::proxy)
>                 [ "$http_proxy" = "false" ] && http_proxy=""
>                 export http_proxy
>         fi

Good idea.

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 19:57:05 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@debian.org>:
Extra info received and forwarded to list. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 19:57:05 GMT) (full text, mbox, link).


Message #30 received at 766460@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 766460@bugs.debian.org
Subject: Re: Bug#766460: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 12:52:26 -0700
[Message part 1 (text/plain, inline)]
Control: tags -1 wontfix

On 2014-10-23, Petter Reinholdtsen wrote:
> [Vagrant Cascadian]
>> I don't think this is appropriate to fix in ltsp-client-builder, as it
>> won't work when running outside of debian-installer.
>
> I thought ltsp-client-builder was a udeb only to be used inside
> debian-installer?  In what other environment is ltsp-client-builder
> used?

ltsp-client-builder udeb is essentially a wrapper around the
ltsp-build-client commandline tool. By setting the http_proxy variable
in the udeb, it doesn't resolve the issue when running the tool from the
commandline.

live well,
  vagrant
[Message part 2 (application/pgp-signature, inline)]

Added tag(s) wontfix. Request was from Vagrant Cascadian <vagrant@debian.org> to 766460-submit@bugs.debian.org. (Thu, 23 Oct 2014 19:57:05 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 20:06:09 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 20:06:09 GMT) (full text, mbox, link).


Message #37 received at 766460@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: 766460@bugs.debian.org
Subject: Re: Bug#766460: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 22:02:41 +0200
[Vagrant Cascadian]
> ltsp-client-builder udeb is essentially a wrapper around the
> ltsp-build-client commandline tool. By setting the http_proxy
> variable in the udeb, it doesn't resolve the issue when running the
> tool from the commandline.

Sure.  But in this case, my proposal is to set the proxy to the value
used by debian-installer when running as part of debian-installer.
This is different from and should be different from running it on the
command line outside debian-installer, as the values from d-i should
be used in this environment.

Outside d-i, I would expect ltsp-build-client to inherit proxy values
from the current environment, and this work already as far as I can
tell.

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#766460; Package ltsp-client-builder. (Thu, 23 Oct 2014 20:33:22 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@debian.org>:
Extra info received and forwarded to list. Copy sent to LTSP Debian Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (Thu, 23 Oct 2014 20:33:22 GMT) (full text, mbox, link).


Message #42 received at 766460@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 766460@bugs.debian.org
Subject: Re: Bug#766460: ltsp-client-builder: Need to set web proxy environment in postinst
Date: Thu, 23 Oct 2014 13:29:23 -0700
[Message part 1 (text/plain, inline)]
On 2014-10-23, Petter Reinholdtsen wrote:
> [Vagrant Cascadian]
>> ltsp-client-builder udeb is essentially a wrapper around the
>> ltsp-build-client commandline tool. By setting the http_proxy
>> variable in the udeb, it doesn't resolve the issue when running the
>> tool from the commandline.
>
> Sure.  But in this case, my proposal is to set the proxy to the value
> used by debian-installer when running as part of debian-installer.
> This is different from and should be different from running it on the
> command line outside debian-installer, as the values from d-i should
> be used in this environment.

But ltsp-build-client does use the proxy configured in apt regardless of
weather it's running in debian-installer or not, and apt is configured
by debian-installer...


> Outside d-i, I would expect ltsp-build-client to inherit proxy values
> from the current environment, and this work already as far as I can
> tell.

But the script you referenced earlier would fail when run outside of
debian-installer, because it runs before the proxy values are set in the
ltsp-build-client plugins.

Given that the only code that breaks here is not part of LTSP, I think
it is appropriate to fix it in that code, not in LTSP.


live well
  vagrant
[Message part 2 (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 1 13:08:33 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.