3
0
Fork 0
forked from mirrors/nixpkgs

* The Powers That Be have decided that there shall be a /run to

replace /var/run and /var/lock.  For instance, udev now keeps state
  in /run/udev instead of /dev/.udev.  See

    http://lists.fedoraproject.org/pipermail/devel/2011-March/150031.html
    http://bugs.freestandards.org/show_bug.cgi?id=718

  So this patch creates /run as a tmpfs, and symlinks /var/run to /run
  and /var/lock to /run/lock.

  TODO: create /run in stage 1 and propagate it to stage 2.    

svn path=/nixos/trunk/; revision=27803
This commit is contained in:
Eelco Dolstra 2011-07-16 19:27:45 +00:00
parent 23d7a822f1
commit 14636ba057
3 changed files with 13 additions and 14 deletions

View file

@ -16,8 +16,6 @@ let
setupScript =
''
mkdir -p /var/lock
if ! test -d /home/smbd ; then
mkdir -p /home/smbd
chown ${user} /home/smbd

View file

@ -98,9 +98,7 @@ mkdir -m 0755 -p /etc/nixos
# Miscellaneous boot time cleanup.
rm -rf /var/run
rm -rf /var/lock
rm -rf /var/log/upstart
rm -rf /run /var/run /var/lock /var/log/upstart
#echo -n "cleaning \`/tmp'..."
#rm -rf --one-file-system /tmp/*
@ -123,14 +121,17 @@ rm -rf /nix/var/nix/chroots # recreated in activate-configuration.sh
rm -rf /nix/var/nix/gcroots/tmp /nix/var/nix/temproots
# Use a tmpfs for /var/run to ensure that / or /var can be unmounted
# or at least remounted read-only during shutdown. (Upstart 0.6
# apparently uses nscd to do some name lookups, resulting in it
# holding some mmap mapping to deleted files in /var/run/nscd.
# Similarly, portmap and statd have open files in /var/run and are
# needed during shutdown to unmount NFS volumes.)
mkdir -m 0755 -p /var/run
mount -t tmpfs -o "mode=755" none /var/run
# Create a tmpfs on /run to hold runtime state for programs such as
# udev.
mkdir -m 0755 -p /run
mount -t tmpfs -o "mode=755" none /run
mkdir -m 0700 -p /run/lock
# For backwards compatibility, symlink /var/run to /run, and /var/lock
# to /run/lock.
ln -s /run /var/run
ln -s /run/lock /var/lock
# Clear the resume device.

View file

@ -94,7 +94,7 @@ with pkgs.lib;
# Skip various special filesystems. Non-existent
# mount points are typically tmpfs/aufs mounts from
# the initrd.
if [ "$mp" = /proc -o "$mp" = /sys -o "$mp" = /dev -o "$device" = "rootfs" -o "$mp" = /var/run -o ! -e "$mp" ]; then continue; fi
if [ "$mp" = /proc -o "$mp" = /sys -o "$mp" = /dev -o "$device" = "rootfs" -o "$mp" = /run -o "$mp" = /var/run -o "$mp" = /var/lock -o ! -e "$mp" ]; then continue; fi
echo "unmounting $mp..."