Linux schroot无法正确同步nss数据库(passwd、组、主机)

Linux schroot无法正确同步nss数据库(passwd、组、主机),linux,chroot,schroot,Linux,Chroot,Schroot,我试图使用schroot来处理多个chroot环境,为特定版本的ubuntu生成干净的开发版本。主机环境是Ubuntu 16.04 我使用以下配置创建了/etc/schroot/chroot.d/test.conf: [test] description=ubuntu trusty type=directory # DO NOT FORGET THIS LINE directory=/var/chroot/test shell=/bin/bash groups=sudo profile=desk

我试图使用schroot来处理多个chroot环境,为特定版本的ubuntu生成干净的开发版本。主机环境是Ubuntu 16.04

我使用以下配置创建了/etc/schroot/chroot.d/test.conf:

[test]
description=ubuntu trusty
type=directory # DO NOT FORGET THIS LINE
directory=/var/chroot/test
shell=/bin/bash
groups=sudo
profile=desktop
personality=linux
preserve-environment=true
message-verbosity=verbose
然后,我使用以下内容创建了chroot:

sudo debootstrap --arch amd64 --variant=buildd trusty /var/chroot/test http://archive.ubuntu.com/ubuntu
该命令工作正常,并且创建了chroot。然后通过以下方式输入chroot:

schroot -c test
groups: cannot find name for group ID 1000
groups: cannot find name for group ID 108
groups: cannot find name for group ID 124
groups: cannot find name for group ID 135
groups: cannot find name for group ID 137
I have no name!@xps-dev:/$ 
无论我尝试了什么,我都无法将/etc/passwd、/etc/group、/etc/hosts等文件正确复制到chrooted环境或与之同步。在本例中,我将配置文件设置为“桌面”,这应该利用/etc/schroot/desktop中的设置信息,但我也尝试创建自己的配置文件,但没有成功。在任何情况下,桌面配置文件都会指定应在这些文件上进行复制或同步:

awake@xps-dev:/etc/schroot/desktop$ cat copyfiles 
# Files to copy into the chroot from the host system.
#
# <source and destination>
/etc/resolv.conf
awake@xps-dev:/etc/schroot/desktop$ cat nssdatabases 
# System databases to copy into the chroot from the host system.
#
# <database name>
passwd
shadow
group
gshadow
services
protocols
networks
hosts
日志如下:

我在日志中没有看到任何确认安装脚本已执行的内容

我显然做错了什么。有人有主意吗


谢谢

我找到了问题的解决方案:如果test.conf文件中没有“type=directory”行,则类型将变为“plain”,这意味着不会调用概要文件中的安装脚本。添加行后,安装脚本开始被调用,现在一切都正常工作。

听起来像是您删除了包含注释的行
type=directory#不要忘记这行
,并添加了一行没有注释的行
type=directory
,然后它开始工作。对的
sudo schroot -v --debug=notice -c test -u root