Bug 17894 - schroot fails to copy files listed in nssdatabases or copyfile; fails to mount /home directories
Summary: schroot fails to copy files listed in nssdatabases or copyfile; fails to moun...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 5
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Philippe Makowski
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-07 18:54 CET by Hoyt Duff
Modified: 2016-03-09 08:53 CET (History)
0 users

See Also:
Source RPM: schroot-1.7.2-4.mga5.src.rpm
CVE:
Status comment:


Attachments

Description Hoyt Duff 2016-03-07 18:54:16 CET
Description of problem:

Creating a chroot environment according to Mageia Wiki directions and configuring schroot per the example config file and launching schroot as user will fail to copy the necessary files listed in copyfile or nssdatabases and fail to mount the /home directories

Version-Release number of selected component (if applicable):
schroot-1.7.2-4.mga5

My system:
Mageia5 4.1.15-desktop-2.mga5 x86_64 

Steps to Reproduce:

Following directions at https://wiki.mageia.org/en/Chroot

1.# mkdir -p /mnt/chroot/mageia32
2.# urpmi.addmedia --distrib --urpmi-root /mnt/chroot/mageia32 ftp://mageia.jameswhitby.net/mageia/distrib/5/i586/
3.# urpmi  --urpmi-root /mnt/chroot/mageia basesystem urpmi locales-en
4.# urpmi schroot
5. Edit /etc/schroot/schroot.conf following the example as follows:

[Mageia32]
description=Mageia5 32-bit
directory=/mnt/chroot/mageia32
users=hoyt
groups=hoyt
root-groups=root,hoyt
aliases=mageia32,default

6. $ schroot -c mageia32

RESULTS:
id: cannot find name for user ID 500 # <== this is my correct user id
-bash-4.3$ ls
-bash: history: /home/hoyt/.bash_history: cannot create: Permission denied
-bash-4.3$  su -
su: user root does not exist
-bash: history: /home/hoyt/.bash_history: cannot create: Permission denied

None of the files listed in /etc/schroot/default/nssdatabases have been copied into the chroot environment. The file that are there are the default files from the initial installation.
David Walser 2016-03-08 01:46:28 CET

Assignee: bugsquad => makowski.mageia

Comment 1 Philippe Makowski 2016-03-08 19:27:00 CET
hum, try with :

[Mageia32]
description=Mageia5 32-bit
type=directory
directory=/mnt/chroot/mageia32
users=hoyt
groups=hoyt
root-groups=root,hoyt
aliases=mageia32,default
preserve-environment=true
Comment 2 Philippe Makowski 2016-03-08 20:14:46 CET
another point, if you make a 32bit chroot in a 64bit box, you also need to add :
personality=linux32

see man
Comment 3 Hoyt Duff 2016-03-08 21:09:39 CET
I will try that this evening.

I had also created an identical 64-bit chroot enviromemt that produced the same results as I shared for the 32-bit chroot.
Comment 4 Hoyt Duff 2016-03-08 21:58:21 CET
I had some time at work, so I duplicated the installation here. 

With the configuration changes you suggested,

[Mageia32]
description=Mageia5 32-bit
type=directory
directory=/mnt/chroot/mageia32
users=hoyt
groups=hoyt
root-groups=root,hoyt
aliases=mageia32,default
preserve-environment=true
personality=linux32


It appears to work as expected. I added /etc/sudoers to the list in /etc/schroot/default/copyfiles and sudo works as expected. Schroot balked at including it in the list in /etc/schroot/default/nssdatabases.

Thank you. I'm now ready to do some additional exploration with schroot. The use of the union filesystem looks interesting, particularly for building custom rpm packages.

I would suggest modifying the directions at https://wiki.mageia.org/en/Chroot to include a Mageia-centric example, since this is not a bug in the application package, but instead a shortcoming of the documentation.
Comment 5 Hoyt Duff 2016-03-09 00:54:27 CET
As well, the 64-bit schroot works as expected.

Thanks!
Comment 6 Philippe Makowski 2016-03-09 08:53:22 CET
reported as solved

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.