Bug#674846: [buildd-tools-devel] Bug#674846: /etc/resolv.conf should be copied upon every invocaktion, not just session start

2012-11-03 Thread Roger Leigh
On Mon, May 28, 2012 at 09:29:46AM +0100, Roger Leigh wrote:
 On Mon, May 28, 2012 at 09:37:59AM +0200, Joachim Breitner wrote:
  on my laptop, I sometimes have a long running schroot session (several
  days). It seems that schroot is only copying the current
  /etc/resolv.conf when I begin the session, or when it is recovered at
  boot time, but not everytime I enter it. This causes problems when I
  move locations between uses of the session. It also causes problems when
  the schroot init script runs before the network is set up, as it will
  copy an empty /etc/resolv.conf. 
  
  It seems that this could be fixed if always the current /etc/resolv.conf
  is used.
 
 We used to have exec scripts in addition to setup scripts, which
 were run once per command being run, rather than once per session.
 These lived in /etc/schroot/exec.d rather than /etc/schroot/setup.d.
 These were never used for any practical purpose, so they were removed
 some years back.  However, we could certainly add them back to make
 this possible.

The exec script facility has been restored in schroot 1.7.0
(current git master, not yet released).  With exec scripts
re-enabled, you just need to change this line in 20copyfiles:

if [ $STAGE = setup-start ] || [ $STAGE = setup-recover ]; then

to

if [ $STAGE = setup-start ] || [ $STAGE = setup-recover ] || [ $STAGE = 
exec-start ]; then

and it will be run every time a command is run, copying outdated
files into the chroot.

In fact, any setup script can be modified in this way to
to any per-command setup.


The outstanding question here is whether this should be
enabled by default, since this adds additional work for
every command invocation, which could potentially be
quite expensive.  And it also alters the chroot environment,
which you might want to keep consistent within the
context of a session.

The script isn't specific to resolv.conf; it handles copying
of arbitrary files.  So we could add an extra third argument
to each line in copyfiles:
source dest setup|exec
to indicate when you want a file to be copied.


This is really just an issue of how to configure this in a
way convinient for the admin/user.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#674846: [buildd-tools-devel] Bug#674846: /etc/resolv.conf should be copied upon every invocaktion, not just session start

2012-05-28 Thread Roger Leigh
On Mon, May 28, 2012 at 09:37:59AM +0200, Joachim Breitner wrote:
 on my laptop, I sometimes have a long running schroot session (several
 days). It seems that schroot is only copying the current
 /etc/resolv.conf when I begin the session, or when it is recovered at
 boot time, but not everytime I enter it. This causes problems when I
 move locations between uses of the session. It also causes problems when
 the schroot init script runs before the network is set up, as it will
 copy an empty /etc/resolv.conf. 
 
 It seems that this could be fixed if always the current /etc/resolv.conf
 is used.

Hi Joachim,

We used to have exec scripts in addition to setup scripts, which
were run once per command being run, rather than once per session.
These lived in /etc/schroot/exec.d rather than /etc/schroot/setup.d.
These were never used for any practical purpose, so they were removed
some years back.  However, we could certainly add them back to make
this possible.

Should anything else be updated as well?  While it's possible to
update NSS databases etc., these can be potentially expensive
operations, while copy resolv.conf is not.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#674846: [buildd-tools-devel] Bug#674846: /etc/resolv.conf should be copied upon every invocaktion, not just session start

2012-05-28 Thread Joachim Breitner
Hi Roger,

Am Montag, den 28.05.2012, 09:29 +0100 schrieb Roger Leigh:
 Should anything else be updated as well?  While it's possible to
 update NSS databases etc., these can be potentially expensive
 operations, while copy resolv.conf is not.

you’d know that better than me, but I’ll tell you about any missing
files that itch me :-)

Greetings,
Joachim

-- 
Joachim nomeata Breitner
Debian Developer
  nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata


signature.asc
Description: This is a digitally signed message part