[Pkg-sysvinit-devel] Bug#620191: initscripts: [patch] Please support top-level /run

Roger Leigh rleigh at debian.org
Wed Mar 30 22:00:57 UTC 2011


Package: initscripts
Version: 2.88dsf-13.1
Severity: normal
Tags: patch

Note: blocked by #620157 and will require versioned dependency on
base-files once it adds top-level /run.

/run is a new cross-distribution location for the storage of
transient writable files needed from system startup to shutdown, but
which do not require preserving across reboots.  This location is
a replacement for several existing locations in the filesystem
hierarchy:

/var/run (→ /run)
/var/lock (→ /run/lock)
/lib/init/rw (→ /run/init)
/dev/.* (→ /run/*)
/dev/shm/.* (→ /run/*)
writable files under /etc (→ /run/*)

Note files abusing /dev and /dev/shm are in contravention of the
FHS; this provides a location for them in the heierarchy.  It
also provides a location for distribution-specific solutions such
as Debian's /lib/init/rw.  /run will be a cross-distribution location
and is now also used by Fedora/SuSE and others will also be using it.
It's also been proposed to the FHS for standardisation.

https://lwn.net/Articles/436012/
http://thread.gmane.org/gmane.linux.redhat.fedora.devel/146976
http://bugs.freestandards.org/show_bug.cgi?id=718
http://lists.debian.org/debian-devel/2011/03/msg01118.html
http://lists.debian.org/debian-devel/2011/03/msg01119.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620157

The attached patch contains a detailed changelog of the changes, so
I won't repeat it here verbatim.  Outstanding issues are marked
TODO, and may require further discussion to resolve them.

One issue is how best to handle the transition for wheezy.  The
patch takes the most conservative approach, modelled on the
/lib/init/rw approach.  /run is not used until a system reboot, at
which point /etc/init/rcS.d will handle setup.  I create a
compatibility bind mount from /run/init to /lib/init/rw.  I've
currently left out bind mounts/symlink of /var/run and /var/lock;
I'd link to get consensus on how best to handle migration before
doing this last small bit.

We could bind mount if a directory, and create symlinks if not,
or they do not exist (to handle new installs).  But, base-files
will also need to drop these locations from itself so we can
co-opt them.

We could take a less conservative approach and do the migration in
one shot, setting up bind mounts from the existing locations to
/run, which would allow other packages to simply have a versioned
dependency on initscripts to start using /run, rather than waiting
until after wheezy to rely upon it.  But this has a much greater
potential for pain and trouble.  But is certainly feasible on
Linux by doing the following:

  check for /lib/init/rw/.ramfs
    (not in a chroot or bootstrap env; OK to continue)
  bind mount /var/run on /run
    create /run/init and /run/lock
  bind mount /var/lock on /run/lock
  bind mount /lib/init/rw on /run/init

However, we only want to do this once only on initial upgrade;
we don't want to repeat this, or do it following a reboot, or
else things will get seriously screwy.  Note it also needs to
cope with /var/lock and /var/run being symlinks or separately
mounted filesystems; if separately mounted we can mount --move
them and replace with symlinks.


Regards,
Roger

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (550, 'unstable'), (400, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initscripts depends on:
ii  coreutils                   8.5-1        GNU core utilities
ii  debianutils                 3.4.4        Miscellaneous utilities specific t
ii  libc6                       2.11.2-13    Embedded GNU C Library: Shared lib
ii  lsb-base                    3.2-27       Linux Standard Base 3.2 init scrip
ii  mount                       2.17.2-9.1   Tools for mounting and manipulatin
ii  sysv-rc                     2.88dsf-13.1 System-V-like runlevel change mech
ii  sysvinit-utils              2.88dsf-13.1 System-V-like utilities

Versions of packages initscripts recommends:
ii  e2fsprogs                     1.41.12-2  ext2/ext3/ext4 file system utiliti
ii  psmisc                        22.13-1    utilities that use the proc file s

initscripts suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initscripts-run-transition-wip.patch
Type: text/x-diff
Size: 21446 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20110330/13b669b3/attachment.patch>


More information about the Pkg-sysvinit-devel mailing list