title: schroot does not synchronize nss databases (passwd, group, hosts) properly
body: <p>I am trying to use schroot to handle multiple chroot environments to produce clean development builds for specific versions of ubuntu. The host environment is Ubuntu 16.04.</p>
  
  <p>I created /etc/schroot/chroot.d/test.conf with the following config:</p>
  
  <pre><code>[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
  </code></pre>
  
  <p>I then created the chroot with:</p>
  
  <pre><code>sudo debootstrap --arch amd64 --variant=buildd trusty /var/chroot/test http://archive.ubuntu.com/ubuntu
  </code></pre>
  
  <p>The command works fine, and the chroot is created. I then enter the chroot this way:</p>
  
  <pre><code>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:/$ 
  </code></pre>
  
  <p>No matter what I have tried, I can't get files like /etc/passwd, /etc/group, /etc/hosts to be properly copied over or synchronized with the chrooted environment. In this example I have set the profile to "desktop", which should make use of the setup info in /etc/schroot/desktop, but I have also tried creating my own profile without success. In any case, the desktop profile does specify it should copy over those files, or synchronize them:</p>
  
  <pre><code>awake@xps-dev:/etc/schroot/desktop$ cat copyfiles 
  # Files to copy into the chroot from the host system.
  #
  # &lt;source and destination&gt;
  /etc/resolv.conf
  awake@xps-dev:/etc/schroot/desktop$ cat nssdatabases 
  # System databases to copy into the chroot from the host system.
  #
  # &lt;database name&gt;
  passwd
  shadow
  group
  gshadow
  services
  protocols
  networks
  hosts
  </code></pre>
  
  <p>I have tried removing "passwd" and "group" from the nssdatabases file to add "/etc/passwd" and "/etc/group" to copyfiles so that the files would get copied over directly, rather than synchronized, but it didn't work.</p>
  
  <p>I have tried the following command to enter the chroot as root with verbose output:</p>
  
  <pre><code>sudo schroot -v --debug=notice -c test -u root
  </code></pre>
  
  <p>The log is here: <a href="http://pastie.org/10947460" rel="nofollow">http://pastie.org/10947460</a></p>
  
  <p>I don't see anything in the log that confirms the setup scripts have been executed.</p>
  
  <p>I am obviously doing something wrong. Does anybody have an idea?</p>
  
  <p>Thanks!</p>