[Buildd-tools-devel] schroot question

Steven Hirsch snhirsch at gmail.com
Sun Jan 11 18:08:06 UTC 2009


On Sun, 11 Jan 2009, Roger Leigh wrote:

>> If I start automount manually using sudo inside the chroot, 10mount seems
>> to clean up.  Actually, it does too thorough a job by removing not only
>> the mount, but the $CHROOT/net mountpoint directly as well!
>
> do_umount_all should run schroot-listmounts to get a list of the
> mounted filesystems and then umount each one.  It doesn't remove
> any mountpoints at that stage.  Is something else doing this?

Can't say.  I can only note that it's nothing I'm doing!

> If your chroot in /var/chroot/... is the location=... parameter in
> schroot.conf, then this directory will get bind mounted under
> /var/lib/schroot/<session>.  This latter location is the one which
> is chrooted into.
>
> This indirection allows us to support multiple chroot "sources" such
> as devices, LVM snapshots and zip/tar files in a uniform manner (they
> all are unpacked/mounted under /var/lib/schroot/<session>.

Ok, now I see.  Thanks for clarifying.

> Your home directory is determined using the same mechanism as for a
> normal login.  i.e. $HOME and pass.pw_dir in the system passwd file.
> The -d option only changes the directory the command is run in, by
> chdir()ing to it.  This is independent of the $HOME/passwd home
> directory, though you can use the -p option to pass $HOME through.

But that passes through everything, correct?  I wish there were a means to 
specify environment variables individually on the command line.

>> Then I added a following line to set HOME in the environment to the
>> now-available automount location (/net/home/hirsch) and do a cd to it.
>> Now things really get weird:  It starts the automounter fine, but
>> immediately fails with a complaint that the directory does not exist.
>> Yet, when it next returns to the command prompt I can type 'cd' and end
>> up there without incident.  ???
>>
>> A race condition of some sort?
>
> Maybe a delay in the userspace part of the automounter to work?
> If it runs parallel to the user's script/shell, it could well race.

I have to think it's a race, but introducing a 'sleep 5' didn't seem to 
mitigate it.  I'll tinker some more.

My guess is that it will work fine if run from schroot prior to it's 
dropping root privileges.


Steve


-- 



More information about the Buildd-tools-devel mailing list