[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Managing users and groups within multiple devel chroots.

Hash: SHA1

Rob Browning <rlb@defaultvalue.org> writes:

> Roger Leigh <rleigh@whinlatter.ukfsn.org> writes:
>> Notice that the /etc/schroot/setup.d/30passwd was used to sync the
>> passwd and related files by copying them into the chroot from the main
>> system.  While it's a simple copy in this case, you can easily
>> customise the script to sync the other way on session shutdown, and
>> make this as complex as you like if you want to take care of the
>> locking issues properly.
>> The scripts allow one to customise and configure the chroot quite
>> easily, so it can (for example) mount block devices on demand, and
>> (later tonight, once I write it) create, mount and destroy LVM
>> snapshots on the fly.
> Hmm.  That seems like a nice tool, but in this case, I want to keep
> the chroots around all the time with home bind mounted so that the
> chroots are available to everyone, and I don't want there to be any
> period of time after installing a package in one chroot (or on the
> host) where the users/groups don't match everywhere.

I think bind mounts are probably appropriate in this case.  That's
what I was using until yesterday, but then I wanted to make the most
use of my new toy ;-)

You could use schroot with all the mounts set up if you wanted.
That's how I use it, but I do get tired of the huge mount table.

<Unrelated, but I'm too excited to keep quiet!>
I now have LVM snapshotting working!

$ ./schroot -c sid-snap -v
run-parts: executing /etc/schroot/setup.d/00check
CHROOT_DESCRIPTION=Debian sid snapshot
CHROOT_MOUNT_OPTIONS=-o atime,sync,user_xattr
run-parts: executing /etc/schroot/setup.d/05lvm
  Logical volume "sid_chroot-snapshot" created
run-parts: executing /etc/schroot/setup.d/10mount
mount: you didn't specify a filesystem type for /dev/hda_vg/sid_chroot-snapshot
       I will try type ext3
/dev/mapper/hda_vg-sid_chroot--snapshot on /mnt type ext3 (rw,sync,user_xattr)
proc on /mnt/proc type proc (rw)
/dev/pts on /mnt/dev/pts type none (rw,bind)
tmpfs on /mnt/dev/shm type tmpfs (rw)
/home on /mnt/home type none (rw,bind)
/tmp on /mnt/tmp type none (rw,bind)
run-parts: executing /etc/schroot/setup.d/20network
`/etc/resolv.conf' -> `/mnt/etc/resolv.conf'
run-parts: executing /etc/schroot/setup.d/30passwd
`/etc/passwd' -> `/mnt/etc/passwd'
`/etc/shadow' -> `/mnt/etc/shadow'
`/etc/group' -> `/mnt/etc/group'
run-parts: executing /etc/schroot/setup.d/50chrootname
Setting chroot name to sid-snap
[sid-snap chroot] Running login shell: “/bin/bash”
(sid)rleigh@hardknott:~/projects/schroot/schroot$ logout
run-parts: executing /etc/schroot/setup.d/50chrootname
run-parts: executing /etc/schroot/setup.d/30passwd
run-parts: executing /etc/schroot/setup.d/20network
run-parts: executing /etc/schroot/setup.d/10mount
/tmp umounted
/home umounted
tmpfs umounted
/dev/pts umounted
proc umounted
/dev/mapper/hda_vg-sid_chroot--snapshot umounted
run-parts: executing /etc/schroot/setup.d/05lvm
  Logical volume "sid_chroot-snapshot" successfully removed
run-parts: executing /etc/schroot/setup.d/00check

Now the only remaining feature is disconnected session management, and
it's basically complete.

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>


Reply to: