Go to file
aszlig dd98b6fb9f
nixos/stage2: Fix mounting special filesystems
This partially reverts commit ab9537ca22.

From the manpage of systemd-nspawn(1):

  Note that systemd-nspawn will mount file systems private to the
  container to /dev, /run and similar.

Testing this in a shell turns out:

$ sudo systemd-nspawn --bind-ro=/nix/store "$(readlink "$(which ls)")" /proc
Spawning container aszlig on /home/aszlig.
Press ^] three times within 1s to kill container.
/etc/localtime does not point into /usr/share/zoneinfo/, not updating
container timezone.
1          execdomains  kpageflags    stat
acpi       fb           loadavg       swaps
asound     filesystems  locks         sys
buddyinfo  fs           meminfo       sysrq-trigger
bus        interrupts   misc          sysvipc
cgroups    iomem        modules       thread-self
cmdline    ioports      mounts        timer_list
config.gz  irq          mtrr          timer_stats
consoles   kallsyms     net           tty
cpuinfo    kcore        pagetypeinfo  uptime
crypto     key-users    partitions    version
devices    keys         scsi          vmallocinfo
diskstats  kmsg         self          vmstat
dma        kpagecgroup  slabinfo      zoneinfo
driver     kpagecount   softirqs
Container aszlig exited successfully.

So the test on whether PID 1 exists in /proc is enough, because if we
use PID namespaces there actually _is_ a PID 1 (as shown above) and the
special file systems are already mounted. A test on the $containers
variable actually mounts them twice.

This unbreaks NixOS containers and I've tested this against the
containers-imperative NixOS test.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @rickynils, @shlevy, @edolstra
2016-09-07 18:10:08 +02:00
.github PULL_REQUEST_TEMPLATE: rename chroot to sandbox 2016-09-02 21:41:43 +02:00
doc doc/language-frameworks/haskell.md: typo in code example. (#18313) 2016-09-05 13:27:00 +02:00
lib Merge branch 'fix/st-update-0.7' of git://github.com/andsild/nixpkgs 2016-09-06 18:04:48 -04:00
maintainers fetch-kde-qt.sh: modularize script allowing multiple versions 2016-08-25 10:07:03 -05:00
nixos nixos/stage2: Fix mounting special filesystems 2016-09-07 18:10:08 +02:00
pkgs libchop: a hack to work around broken guile path detection 2016-09-07 18:06:53 +02:00
.gitignore kde5: consolidate packages into desktops/kde-5 2016-03-01 10:36:00 -06:00
.mention-bot mention-bot: blacklist all-packages.nix 2016-09-03 13:21:53 +02:00
.travis.yml Revert "travis: only fetch top commit" 2016-09-07 17:14:38 +02:00
.version unstable is now 17.03 2016-09-02 08:47:21 +02:00
COPYING COPYING: Update year range to 2016 (close #12621) 2016-01-26 10:10:45 +01:00
default.nix Separate fix-point from config importing hacks and other impurities 2016-07-14 14:33:23 -07:00
README.md README.md: add code triagers badge 2016-07-22 15:00:55 +02:00

logo

Build Status Code Triagers Badge Issue Stats Issue Stats

Nixpkgs is a collection of packages for the Nix package manager. It is periodically built and tested by the hydra build daemon as so-called channels. To get channel information via git, add nixpkgs-channels as a remote:

% git remote add channels git://github.com/NixOS/nixpkgs-channels.git

For stability and maximum binary package support, it is recommended to maintain custom changes on top of one of the channels, e.g. nixos-16.03 for the latest release and nixos-unstable for the latest successful build of master:

% git remote update channels
% git rebase channels/nixos-16.03

For pull-requests, please rebase onto nixpkgs master.

NixOS linux distribution source code is located inside nixos/ folder.

Communication: