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

2011-04-13 Thread Roger Leigh
On Wed, Apr 13, 2011 at 01:02:02AM +0100, Roger Leigh wrote:
 On Fri, Apr 08, 2011 at 10:52:48AM +0100, Roger Leigh wrote:
  I've attached an updated patch; exactly the same as before, but with
  a couple of typos in comments fixed (thanks to Michael Biebl for
  reviewing it).
 
 Updated patch attached.  Based on the patch series in this
 temporary git repo (created for just this work):
 http://git.debian.org/?p=collab-maint/sysvinit;a=summary
 git://git.debian.org/collab-maint/sysvinit
 
 This patch adds a number of fixes, and additionally also
 migrates /dev/shm to /run/shm.  It also adds the ability to
 mount /tmp as a tmpfs with RAMTMP=yes, and have /run/shm
 use the main /run tmpfs with RAMSHM=no.
 
 I also went through the initscripts bugs with mbiebl, and
 this closes 15 bugs which /run and the associated changes
 fix.

Patch rebased on top of Christian's NMU.  Also added special
handling for /tmp and a symlink and added default size and
mode for each tmpfs in /etc/default/tmpfs and removed mode
hardcoding from scripts.


-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff --git a/debian/changelog b/debian/changelog
index de9ca77..ef717c8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,107 @@
+sysvinit (2.88dsf-13.3) unstable; urgency=low
+
+  [ Roger Leigh ]
+  * Non-maintainer upload.
+  * Support for new top-level directory /run to replace /var/run,
+/var/lock and /lib/init/rw as a place to store transient
+writable data which should not be preserved across a system
+reboot (Closes: #186892, #616571, #620191).  /run fixes existing
+issues with RAMRUN and RAMLOCK options using tmpfs on /var/run and
+/var/lock (Closes: #423405, #481546, #564635, #607136, #620735).
+Additionally, /run/shm replaces /dev/shm and may share the same
+tmpfs as /run if RAMSHM is set to no in /etc/default/rcS.  /tmp
+may also be configured to be a tmpfs if RAMTMP is set to yes in
+/etc/default/rcS.
+Summary:
+  /var/run → /run
+  /var/lock → /run/lock
+  /dev/shm → /run/shm
+  /lib/init/rw → /run (not transitioned automatically)
+  /dev/.* → /run (not transitioned automatically)
+These changes do not take effect until the system is rebooted as
+is currently done for /lib/init/rw setup.  Prior to a reboot, the
+paths are made available via bind/nullfs mounts.  Following a reboot,
+the old paths will be converted to symlinks, or bind/nullfs mounts
+where symlinking is not possible, to allow access via either the old
+or new paths, to permit programs using the old paths to transition to
+use the new paths for wheezy.
+- debian/initscripts.postinst:
+  Take chroot detection logic from udev postinst (existing logic was
+  broken).
+  Trigger reboot to complete transition.
+  If the system has not yet transitioned to a tmpfs-based /run, set up
+  bind mounts as follows:
+/var/run → /run
+/var/lock → /run/lock
+/dev/shm → /run/shm
+  On reboot, the system will complete the migration to a tmpfs-based
+  /run; this creates the directory heierachy from the old paths to
+  enable the use of the new /run paths prior to a restart.  This means
+  packages may transition to using /run with a versioned dependency
+  upon initscripts.
+  Remove special handling for RAMRUN and RAMLOCK, which is now taken
+  care of by /run.
+  If in a chroot environment, directly move the directories to the new
+  locations rather than bind mount; since chroots don't run rcS
+  scripts, the changes would otherwise be lost.
+- debian/src/initscripts/Makefile:
+  Provide top-level /run.
+- debian/src/initscripts/doc/README.Debian:
+  Document new use of RUN_SIZE and LOCK_SIZE.
+  Document use of /run rather than /lib/init/rw.
+  Document use of SHM_SIZE and TMP_SIZE.
+- debian/src/initscripts/etc/init.d/checkroot.sh:
+  Use /run in place of /lib/init/rw.
+- debian/src/initscripts/etc/default/tmpfs:
+  Document TMPFS_SIZE, RUN_SIZE and LOCK_SIZE (Closes: #483643).
+  Document TMP_SIZE and SHM_SIZE.
+- debian/src/initscripts/etc/init.d/mountkernfs.sh:
+  Create /run, /run/sendsigs.omit.d and /run/lock.
+  Mount /run/lock as a separate tmpfs if RAMLOCK=yes.
+  /run/lock has 01777 permissions to match /var/lock.
+  Mount /tmp as a separate tmpfs if RAMTMP=yes or / is being mounted
+  read-only (Closes: #503805, #585543).
+  Drop mounting of /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/mountdevsubfs.sh:
+  Create /run/shm.  Mount /run/shm as a separate tmpfs if RAMSHM=yes.
+- debian/src/initscripts/etc/init.d/mtab.sh:
+  domtab mirrors behaviour of domount in mount-functions exactly, to
+ 

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

2011-04-12 Thread Roger Leigh
On Fri, Apr 08, 2011 at 10:52:48AM +0100, Roger Leigh wrote:
 I've attached an updated patch; exactly the same as before, but with
 a couple of typos in comments fixed (thanks to Michael Biebl for
 reviewing it).

Updated patch attached.  Based on the patch series in this
temporary git repo (created for just this work):
http://git.debian.org/?p=collab-maint/sysvinit;a=summary
git://git.debian.org/collab-maint/sysvinit

This patch adds a number of fixes, and additionally also
migrates /dev/shm to /run/shm.  It also adds the ability to
mount /tmp as a tmpfs with RAMTMP=yes, and have /run/shm
use the main /run tmpfs with RAMSHM=no.

I also went through the initscripts bugs with mbiebl, and
this closes 15 bugs which /run and the associated changes
fix.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff --git a/debian/changelog b/debian/changelog
index a59f4e7..b65cc27 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,106 @@
+sysvinit (2.88dsf-13.1run0) UNRELEASED; urgency=low
+
+  [ Martin F. Krafft ]
+  * Add comments to /etc/default/rcS (Closes: #530582).
+
+  [ Roger Leigh ]
+  * Support for new top-level directory /run to replace /var/run,
+/var/lock and /lib/init/rw as a place to store transient
+writable data which should not be preserved across a system
+reboot (Closes: #186892, #616571, #620191).  /run fixes existing
+issues with RAMRUN and RAMLOCK options using tmpfs on /var/run and
+/var/lock (Closes: #423405, #481546, #564635, #607136, #620735).
+Additionally, /run/shm replaces /dev/shm and may share the same
+tmpfs as /run if RAMSHM is set to no in /etc/default/rcS.  /tmp
+may also be configured to be a tmpfs if RAMTMP is set to yes in
+/etc/default/rcS.
+Summary:
+  /var/run → /run
+  /var/lock → /run/lock
+  /dev/shm → /run/shm
+  /lib/init/rw → /run (not transitioned automatically)
+  /dev/.* → /run (not transitioned automatically)
+These changes do not take effect until the system is rebooted as
+is currently done for /lib/init/rw setup.  Prior to a reboot, the
+paths are made available via bind/nullfs mounts.  Following a reboot,
+the old paths will be converted to symlinks, or bind/nullfs mounts
+where symlinking is not possible, to allow access via either the old
+or new paths, to permit programs using the old paths to transition to
+use the new paths for wheezy.
+- debian/initscripts.postinst:
+  Take chroot detection logic from udev postinst (existing logic was
+  broken).
+  Trigger reboot to complete transition.
+  If the system has not yet transitioned to a tmpfs-based /run, set up
+  bind mounts as follows:
+/var/run → /run
+/var/lock → /run/lock
+/dev/shm → /run/shm
+  On reboot, the system will complete the migration to a tmpfs-based
+  /run; this creates the directory heierachy from the old paths to
+  enable the use of the new /run paths prior to a restart.  This means
+  packages may transition to using /run with a versioned dependency
+  upon initscripts.
+  Remove special handling for RAMRUN and RAMLOCK, which is now taken
+  care of by /run.
+  If in a chroot environment, directly move the directories to the new
+  locations rather than bind mount; since chroots don't run rcS
+  scripts, the changes would otherwise be lost.
+- debian/src/initscripts/Makefile:
+  Provide top-level /run.
+- debian/src/initscripts/doc/README.Debian:
+  Document new use of RUN_SIZE and LOCK_SIZE.
+  Document use of /run rather than /lib/init/rw.
+  Document use of SHM_SIZE and TMP_SIZE.
+- debian/src/initscripts/etc/init.d/checkroot.sh:
+  Use /run in place of /lib/init/rw.
+- debian/src/initscripts/etc/default/tmpfs:
+  Document TMPFS_SIZE, RUN_SIZE and LOCK_SIZE (Closes: #483643).
+  Document TMP_SIZE and SHM_SIZE.
+- debian/src/initscripts/etc/init.d/mountkernfs.sh:
+  Create /run, /run/sendsigs.omit.d and /run/lock.
+  Mount /run/lock as a separate tmpfs if RAMLOCK=yes.
+  /run/lock has 01777 permissions to match /var/lock.
+  Mount /tmp as a separate tmpfs if RAMTMP=yes or / is being mounted
+  read-only (Closes: #503805, #585543).
+  Drop mounting of /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/mountdevsubfs.sh:
+  Create /run/shm.  Mount /run/shm as a separate tmpfs if RAMSHM=yes.
+- debian/src/initscripts/etc/init.d/mtab.sh:
+  domtab mirrors behaviour of domount in mount-functions exactly, to
+  prevent duplicate mounts (required for bind mount support).
+  Bind mount /run/init and drop mounting of /var/run.  Mount /run/lock
+  in place of /var/lock.
+  Mount /tmp if RAMTMP=yes.
+  

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

2011-04-08 Thread Roger Leigh
On Thu, Apr 07, 2011 at 03:46:20PM +0100, Roger Leigh wrote:
 On Tue, Apr 05, 2011 at 06:55:18PM +0100, Roger Leigh wrote:
  On Sat, Apr 02, 2011 at 02:26:55PM +0100, Roger Leigh wrote:
   Sorry for the patch flood.  Final (hopefully) patch attached following
   some further discussion on #debian-devel.
   
   Note: versioned base-files dependency may require tweaking; waiting
   on base-files upload.
  
  Just to let you know, base-files 6.2 was uploaded today, with
  /run as a new top-level directory.  This is the base-files
  version we depend upon in debian/control, so the latest patch
  provided should be good to go (initscripts-run-transition9.patch).
  
  It would be great if this could be done soon, so that we can
  start transitioning packages to use /run in place of /dev/.xxx
  and /dev/shm/.xxx.  This means upstreams can implement the changes
  now as other distributions are also doing the same transition.
 
 Following the issues with udev using /run incorrectly, which caused
 breakage when base-files introduced /run, I've adjusted the patch
 to:
 
 - provide /run directly
 - remove the base-files dependency

I've attached an updated patch; exactly the same as before, but with
a couple of typos in comments fixed (thanks to Michael Biebl for
reviewing it).

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff --git a/debian/changelog b/debian/changelog
index a59f4e7..bcb0152 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,81 @@
+sysvinit (2.88dsf-13.1run0) UNRELEASED; urgency=low
+
+  * Support for new top-level directory /run to replace /var/run,
+/var/lock and /lib/init/rw as a place to store transient
+writable data which should not be preserved across a system
+reboot.  Summary:
+  /var/run → /run
+  /var/lock → /run/lock
+  /lib/init/rw → /run (not transitioned automatically)
+  /dev/.* → /run (not transitioned automatically)
+These changes do not take effect until the system is rebooted as
+is currently done for /lib/init/rw setup.  Following a reboot, the
+old paths will continue to be available via bind mounts, which will
+permit programs using the old paths to transition to use the new paths
+for wheezy.
+- debian/initscripts.postinst:
+  Take chroot detection logic from udev postinst (existing logic was
+  broken).
+  Trigger reboot to complete transition.
+  If the system has not yet transitioned to a tmpfs-based /run, set up
+  bind mounts as follows:
+/var/run → /run
+/var/lock → /run/lock
+  On reboot, the system will complete the migration to a tmpfs-based
+  /run; this creates the directory heierachy from the old paths to
+  enable the use of the new /run paths prior to a restart.  This means
+  packages may transition to using /run with a versioned dependency
+  upon initscripts.
+  Remove special handling for RAMRUN and RAMLOCK, which is now taken
+  care of by /run.
+  If in a chroot environment, directly move the directories to the new
+  locations rather than bind mount; since chroots don't run rcS
+  scripts, the changes would otherwise be lost.
+- debian/src/initscripts/Makefile:
+  Provide top-level /run.
+- debian/src/initscripts/doc/README.Debian:
+  Document new use of RUN_SIZE and LOCK_SIZE.
+  Document use of /run rather than /lib/init/rw.
+- debian/src/initscripts/etc/init.d/checkroot.sh:
+  Use /run in place of /lib/init/rw.
+- debian/src/initscripts/etc/init.d/mountkernfs.sh:
+  Create /run, /run/sendsigs.omit.d and /run/lock.
+  Mount /run/lock as a separate tmpfs if RAMLOCK=yes.
+  /run/lock has 01777 permissions to match /var/lock.
+  Drop mounting of /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/mtab.sh:
+  domtab mirrors behaviour of domount in mount-functions exactly, to
+  prevent duplicate mounts (required for bind mount support).
+  Bind mount /run/init and drop mounting of /var/run.  Mount /run/lock
+  in place of /var/lock.
+- debian/src/initscripts/etc/init.d/sendsigs:
+  Use new paths:
+files: /run/sendsigs.omit /lib/init/rw/sendsigs.omit
+dirs: /run/sendsigs.omit.d/ /lib/init/rw/sendsigs.omit.d/
+- debian/src/initscripts/etc/init.d/umountfs:
+  Ignore /run.  Continue to ignore /lib/init/rw in order to handle
+  clean shutdown.  Also continue to ignore /var/run and /var/lock
+  Check for presence of .ramfs than configuration variable when
+  skipping /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/umountnfs.sh:
+  Check for presence of .ramfs than configuration variable when
+  skipping /var/run and /var/lock.
+  Ignore /run.  Continue to ignore /lib/init/rw in order to 

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

2011-04-07 Thread Roger Leigh
On Tue, Apr 05, 2011 at 06:55:18PM +0100, Roger Leigh wrote:
 On Sat, Apr 02, 2011 at 02:26:55PM +0100, Roger Leigh wrote:
  Sorry for the patch flood.  Final (hopefully) patch attached following
  some further discussion on #debian-devel.
  
  Note: versioned base-files dependency may require tweaking; waiting
  on base-files upload.
 
 Just to let you know, base-files 6.2 was uploaded today, with
 /run as a new top-level directory.  This is the base-files
 version we depend upon in debian/control, so the latest patch
 provided should be good to go (initscripts-run-transition9.patch).
 
 It would be great if this could be done soon, so that we can
 start transitioning packages to use /run in place of /dev/.xxx
 and /dev/shm/.xxx.  This means upstreams can implement the changes
 now as other distributions are also doing the same transition.

Following the issues with udev using /run incorrectly, which caused
breakage when base-files introduced /run, I've adjusted the patch
to:

- provide /run directly
- remove the base-files dependency

Additionally, I've tested upgrades of this version on a live system
(I'm using it to write this mail; previous patches were tested in kvm
VMs).  It's working fine both before and after a reboot:

% mount
/dev/mapper/hufflepuff-root on / type ext3 
(rw,relatime,user_xattr,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
tmpfs on /run type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
…

As you can see, /run is a tmpfs.

% ls /run
atd.pid cups   postgresql   sshd
avahi-daemondbus   radvdsshd.pid
ConsoleKit  dhclient.eth0.pid  rsyslogd.pid utmp
console-kit-daemon.pid  lock   sambaxdm.pid
crond.pid   motd   screen
crond.rebootntpd.pid   sendsigs.omit.d
hufflepuff% ls /run/lock
aumix

% ls -ld /run /run/lock
drwxr-xr-x 13 root root 500 Apr  7 15:38 /run
drwxrwxrwt  3 root root  80 Apr  7 15:38 /run/lock

% ls -ld /var/run /var/lock
lrwxrwxrwx 1 root root 9 Apr  7 15:38 /var/lock - /run/lock
lrwxrwxrwx 1 root root 4 Apr  7 15:38 /var/run - /run

As you can see, it's all set up correctly to be completely backward
compatible with /var/run and /var/lock, including directory
permissions.  All the system services using /var/run and /var/lock
are now transparently using /run and /run/lock via the compatibility
symlinks.


Summary: the patch is fine to upload now; there are no packages
we are waiting on for the transition.  The patch has been tested both
in VMs and on a live system, and has been found to work correctly.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


signature.asc
Description: Digital signature


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

2011-04-07 Thread Roger Leigh
On Thu, Apr 07, 2011 at 03:46:20PM +0100, Roger Leigh wrote:
 On Tue, Apr 05, 2011 at 06:55:18PM +0100, Roger Leigh wrote:
  On Sat, Apr 02, 2011 at 02:26:55PM +0100, Roger Leigh wrote:
   Sorry for the patch flood.  Final (hopefully) patch attached following
   some further discussion on #debian-devel.
   
   Note: versioned base-files dependency may require tweaking; waiting
   on base-files upload.
  
  Just to let you know, base-files 6.2 was uploaded today, with
  /run as a new top-level directory.  This is the base-files
  version we depend upon in debian/control, so the latest patch
  provided should be good to go (initscripts-run-transition9.patch).
  
  It would be great if this could be done soon, so that we can
  start transitioning packages to use /run in place of /dev/.xxx
  and /dev/shm/.xxx.  This means upstreams can implement the changes
  now as other distributions are also doing the same transition.
 
 Following the issues with udev using /run incorrectly, which caused
 breakage when base-files introduced /run, I've adjusted the patch
 to:
 
 - provide /run directly
 - remove the base-files dependency

Patch actually attached this time...

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff --git a/debian/changelog b/debian/changelog
index a59f4e7..bcb0152 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,81 @@
+sysvinit (2.88dsf-13.1run0) UNRELEASED; urgency=low
+
+  * Support for new top-level directory /run to replace /var/run,
+/var/lock and /lib/init/rw as a place to store transient
+writable data which should not be preserved across a system
+reboot.  Summary:
+  /var/run → /run
+  /var/lock → /run/lock
+  /lib/init/rw → /run (not transitioned automatically)
+  /dev/.* → /run (not transitioned automatically)
+These changes do not take effect until the system is rebooted as
+is currently done for /lib/init/rw setup.  Following a reboot, the
+old paths will continue to be available via bind mounts, which will
+permit programs using the old paths to transition to use the new paths
+for wheezy.
+- debian/initscripts.postinst:
+  Take chroot detection logic from udev postinst (existing logic was
+  broken).
+  Trigger reboot to complete transition.
+  If the system has not yet transitioned to a tmpfs-based /run, set up
+  bind mounts as follows:
+/var/run → /run
+/var/lock → /run/lock
+  On reboot, the system will complete the migration to a tmpfs-based
+  /run; this creates the directory heierachy from the old paths to
+  enable the use of the new /run paths prior to a restart.  This means
+  packages may transition to using /run with a versioned dependency
+  upon initscripts.
+  Remove special handling for RAMRUN and RAMLOCK, which is now taken
+  care of by /run.
+  If in a chroot environment, directly move the directories to the new
+  locations rather than bind mount; since chroots don't run rcS
+  scripts, the changes would otherwise be lost.
+- debian/src/initscripts/Makefile:
+  Provide top-level /run.
+- debian/src/initscripts/doc/README.Debian:
+  Document new use of RUN_SIZE and LOCK_SIZE.
+  Document use of /run rather than /lib/init/rw.
+- debian/src/initscripts/etc/init.d/checkroot.sh:
+  Use /run in place of /lib/init/rw.
+- debian/src/initscripts/etc/init.d/mountkernfs.sh:
+  Create /run, /run/sendsigs.omit.d and /run/lock.
+  Mount /run/lock as a separate tmpfs if RAMLOCK=yes.
+  /run/lock has 01777 permissions to match /var/lock.
+  Drop mounting of /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/mtab.sh:
+  domtab mirrors behaviour of domount in mount-functions exactly, to
+  prevent duplicate mounts (required for bind mount support).
+  Bind mount /run/init and drop mounting of /var/run.  Mount /run/lock
+  in place of /var/lock.
+- debian/src/initscripts/etc/init.d/sendsigs:
+  Use new paths:
+files: /run/sendsigs.omit /lib/init/rw/sendsigs.omit
+dirs: /run/sendsigs.omit.d/ /lib/init/rw/sendsigs.omit.d/
+- debian/src/initscripts/etc/init.d/umountfs:
+  Ignore /run.  Continue to ignore /lib/init/rw in order to handle
+  clean shutdown.  Also continue to ignore /var/run and /var/lock
+  Check for presence of .ramfs than configuration variable when
+  skipping /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/umountnfs.sh:
+  Check for presence of .ramfs than configuration variable when
+  skipping /var/run and /var/lock.
+  Ignore /run.  Continue to ignore /lib/init/rw in order to handle
+  clean shutdown.  Also continue to ignore /var/run and /var/lock
+  if mounted as tmpfs in order 

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

2011-04-05 Thread Roger Leigh
On Sat, Apr 02, 2011 at 02:26:55PM +0100, Roger Leigh wrote:
 Sorry for the patch flood.  Final (hopefully) patch attached following
 some further discussion on #debian-devel.
 
 Note: versioned base-files dependency may require tweaking; waiting
 on base-files upload.

Just to let you know, base-files 6.2 was uploaded today, with
/run as a new top-level directory.  This is the base-files
version we depend upon in debian/control, so the latest patch
provided should be good to go (initscripts-run-transition9.patch).

It would be great if this could be done soon, so that we can
start transitioning packages to use /run in place of /dev/.xxx
and /dev/shm/.xxx.  This means upstreams can implement the changes
now as other distributions are also doing the same transition.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


signature.asc
Description: Digital signature


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

2011-04-02 Thread Roger Leigh
user rle...@debian.org
usertag 620191 run-transition
usertag 620157 run-transition
severity 620191 important
severity 620157 important
block 620191 by 620157

On Fri, Apr 01, 2011 at 06:01:55PM +0100, Roger Leigh wrote:
 On Fri, Apr 01, 2011 at 05:42:53PM +0100, Roger Leigh wrote:
  On Fri, Apr 01, 2011 at 04:19:03PM +0100, Roger Leigh wrote:
   On Fri, Apr 01, 2011 at 03:11:18PM +0100, Roger Leigh wrote:
On Fri, Apr 01, 2011 at 02:18:11PM +0100, Roger Leigh wrote:
 On Thu, Mar 31, 2011 at 06:55:16PM +0100, Roger Leigh wrote:
  On Wed, Mar 30, 2011 at 11:00:57PM +0100, Roger Leigh wrote:
   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.
  
  Updated patch attached.  Handles upgrades and reboots; other than
  the one outstanding TODO item (transition of /lib/init/rw from
  directory to symlink, probably something we can leave until after
  squeeze).
 
 Updated patch attached.  This one has been tested in a VM, and will
 allow a machine to boot and transition to /run safely.
 
 Minor outstanding issue:
 /etc/init.d/mountall.sh fails.  This is due to (apparently) / and 
 /proc
 already being mounted, leading to a 32 exit status.  Maybe an mtab
 issue?
 
 In order to work properly with bind mounts on freebsd kernels, I've
 synched domount and domtab logic so that they behave identically.
 However, I'm seeing some odd double bind mounts in /proc/mounts
 and an incomplete /etc/mtab, so there's possibly something not quite
 right here.
 
 Apart from this one issue, everything else is working fully.

Updated patch attached.  This fixes the above outstanding issues.
It should now be safe for general testing and use.

Note: needs versioned base-files dependency adding.
   
   Updated patch attached; adds kfreebsd support to initscripts postinst.
  
  Updated postinst following feedback on #debian-devel:
  - use uname rather than dpkg --print-architecture
  - simplify conditional logic
 
 Updated to
 - not enable RAMLOCK by default (though doing so removes a DoS we
   are currently vulnerable to even with traditional /var)
 - only use new paths in sendsigs
 Thanks to mbiebl for this review.

Sorry for the patch flood.  Final (hopefully) patch attached following
some further discussion on #debian-devel.

Note: versioned base-files dependency may require tweaking; waiting
on base-files upload.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: debian/control
===
--- debian/control	(revision 1953)
+++ debian/control	(working copy)
@@ -51,7 +51,7 @@
 
 Package: initscripts
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${mount:Depends}, debianutils (= 2.13.1), lsb-base (= 3.2-14), sysvinit-utils (= 2.86.ds1-64), sysv-rc | file-rc, coreutils (= 5.93)
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${mount:Depends}, base-files (= 6.2), debianutils (= 2.13.1), lsb-base (= 3.2-14), sysvinit-utils (= 2.86.ds1-64), sysv-rc | file-rc, coreutils (= 5.93)
 Recommends: psmisc, e2fsprogs
 Conflicts: libdevmapper1.02.1 ( 2:1.02.24-1)
 Replaces: libc6, libc6.1, libc0.1, libc0.3
Index: debian/src/initscripts/share/default.rcS
===
--- debian/src/initscripts/share/default.rcS	(revision 1953)
+++ debian/src/initscripts/share/default.rcS	(working copy)
@@ -13,5 +13,4 @@
 UTC=yes
 VERBOSE=no
 FSCKFIX=no
-RAMRUN=no
 RAMLOCK=no
Index: debian/src/initscripts/doc/README.Debian
===
--- debian/src/initscripts/doc/README.Debian	(revision 1953)
+++ debian/src/initscripts/doc/README.Debian	(working copy)
@@ -4,15 +4,14 @@
 Tmpfs can be used as virtual memory filesystem. glibc 2.2 and above
 expects a tmpfs to be mounted at /dev/shm for POSIX shared memory,
 this is done automatically by /etc/init.d/mountdevsubfs.sh early in
-the boot process. You can limit tmpfs max size by setting the
-SHM_SIZE variable to a desired size in the /etc/default/tmpfs file
-to prevent tmpfs from using up all system memory.
+the boot process. You can limit tmpfs max size by setting the SHM_SIZE
+variable to a desired size in the /etc/default/tmpfs file to prevent
+tmpfs from using up all system memory.
 
-A tmpfs can also be mounted over /var/run/ and /var/lock/. This can
-be achieved by setting the RAMRUN and RAMLOCK variables to yes in
-the /etc/default/rcS file. A size limit for the tmpfs filesystem
-mounted over /var/run/ and /var/lock/ can be set via the RUN_SIZE
-and 

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

2011-04-01 Thread Sedat Dilek
Resend (b0rked subject line, add TO BR initiator).

- Sedat -


-- Forwarded message --
From: Sedat Dilek sedat.di...@googlemail.com
Date: Fri, Apr 1, 2011 at 9:18 AM
Subject: Re: 620...@bugs.debian.org
To: 620...@bugs.debian.org


Hi,

[1] says:
...
I've filed a bug (#620191) against initscripts containing a proposed
patch for this.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620191

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

Whereas in initscripts-run-transition-wip2.patch I see:
...
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/Makefile
sysvinit-2.88dsf/debian/src/initscripts/Makefile
--- sysvinit-2.88dsf.original/debian/src/initscripts/Makefile   2011-03-30
16:46:27.675265266 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/Makefile    2011-03-30
16:54:07.988949558 +0100
@@ -10,7 +10,7 @@
 all:

 install:
-       $(INSTALL) -d $(DESTDIR)/lib/init/rw/.
+       ln -s /run $(DESTDIR)/lib/init/rw
...

Shouldn't that be?

ln -s /run/init $(DESTDIR)/lib/init/rw

Test-Case:

# mkdir -p /run/init
# ln -s /run/init /lib/init/rw-test
# touch /lib/init/rw-test/teschd

# ls -l /lib/init/rw-test
lrwxrwxrwx 1 root root 9  1. Apr 09:12 /lib/init/rw-test - /run/init
# ls -l /run/init/
insgesamt 0
-rw-r--r-- 1 root root 0  1. Apr 09:16 teschd

- Sedat -

[1] http://lists.debian.org/debian-devel/2011/03/msg01150.html



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2011-04-01 Thread Roger Leigh
On Fri, Apr 01, 2011 at 10:55:43AM +0200, Sedat Dilek wrote:
  install:
 -       $(INSTALL) -d $(DESTDIR)/lib/init/rw/.
 +       ln -s /run $(DESTDIR)/lib/init/rw
 ...
 
 Shouldn't that be?
 
 ln -s /run/init $(DESTDIR)/lib/init/rw

Yes.  In my latest patch (to be submitted shortly), I have removed this
change since we can't replace a directory with a symlink on package
upgrade (since it has a mounted tmpfs on top of it).  We'll have to
do this part after wheezy is released.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


signature.asc
Description: Digital signature


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

2011-04-01 Thread Roger Leigh
On Thu, Mar 31, 2011 at 06:55:16PM +0100, Roger Leigh wrote:
 On Wed, Mar 30, 2011 at 11:00:57PM +0100, Roger Leigh wrote:
  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.
 
 Updated patch attached.  Handles upgrades and reboots; other than
 the one outstanding TODO item (transition of /lib/init/rw from
 directory to symlink, probably something we can leave until after
 squeeze).

Updated patch attached.  This one has been tested in a VM, and will
allow a machine to boot and transition to /run safely.

Minor outstanding issue:
/etc/init.d/mountall.sh fails.  This is due to (apparently) / and /proc
already being mounted, leading to a 32 exit status.  Maybe an mtab
issue?

In order to work properly with bind mounts on freebsd kernels, I've
synched domount and domtab logic so that they behave identically.
However, I'm seeing some odd double bind mounts in /proc/mounts
and an incomplete /etc/mtab, so there's possibly something not quite
right here.

Apart from this one issue, everything else is working fully.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: debian/src/initscripts/share/default.rcS
===
--- debian/src/initscripts/share/default.rcS	(revision 1953)
+++ debian/src/initscripts/share/default.rcS	(working copy)
@@ -13,5 +13,4 @@
 UTC=yes
 VERBOSE=no
 FSCKFIX=no
-RAMRUN=no
-RAMLOCK=no
+RAMLOCK=yes
Index: debian/src/initscripts/doc/README.Debian
===
--- debian/src/initscripts/doc/README.Debian	(revision 1953)
+++ debian/src/initscripts/doc/README.Debian	(working copy)
@@ -4,15 +4,14 @@
 Tmpfs can be used as virtual memory filesystem. glibc 2.2 and above
 expects a tmpfs to be mounted at /dev/shm for POSIX shared memory,
 this is done automatically by /etc/init.d/mountdevsubfs.sh early in
-the boot process. You can limit tmpfs max size by setting the
-SHM_SIZE variable to a desired size in the /etc/default/tmpfs file
-to prevent tmpfs from using up all system memory.
+the boot process. You can limit tmpfs max size by setting the SHM_SIZE
+variable to a desired size in the /etc/default/tmpfs file to prevent
+tmpfs from using up all system memory.
 
-A tmpfs can also be mounted over /var/run/ and /var/lock/. This can
-be achieved by setting the RAMRUN and RAMLOCK variables to yes in
-the /etc/default/rcS file. A size limit for the tmpfs filesystem
-mounted over /var/run/ and /var/lock/ can be set via the RUN_SIZE
-and LOCK_SIZE variables in the /etc/default/tmpfs file.
+A size limit for the tmpfs filesystem mounted over /run can be set via
+the RUN_SIZE variable in the /etc/default/tmpfs file.  Likewise, a
+size limit for the tmpfs filesystem mounted over /run/lock can be set
+via the LOCK_SIZE variable (if enabled with RAMLOCK=yes).
 
 If TMPFS_SIZE is set in /etc/default/tmpfs, it will be used as the
 default value for SHM_SIZE, RUN_SIZE and LOCK_SIZE. Otherwise, kernel
@@ -22,11 +21,10 @@
 sendsigs process omission interface
 ---
 
-Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs
-is able to omit processes from being killed by killall5(8). Process
-id's listed in /var/run/sendsigs.omit, /lib/init/rw/sendsigs.omit or
-any file in the /lib/init/rw/sendsigs.omit.d/ directory will be
-omitted by sendsigs.
+Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs is
+able to omit processes from being killed by killall5(8). Process id's
+listed in /run/sendsigs.omit, /run/init/sendsigs.omit or any file in
+the /run/init/sendsigs.omit.d/ directory will be omitted by sendsigs.
 
 The recommended practise for adding a process id for omission is to
 create a file in /lib/init/rw/sendsigs.omit.d/package name
Index: debian/src/initscripts/lib/init/bootclean.sh
===
--- debian/src/initscripts/lib/init/bootclean.sh	(revision 1953)
+++ debian/src/initscripts/lib/init/bootclean.sh	(working copy)
@@ -112,7 +112,7 @@
 }
 
 clean_lock() {
-	if [ yes = $RAMLOCK ] ; then
+	if [ -f /var/lock/.ramfs ] ; then
 	return 0
 	fi
 
@@ -136,7 +136,7 @@
 }
 
 clean_run() {
-	if [ yes = $RAMRUN ] ; then
+	if [ -f /var/run/.ramfs ] ; then
 	return 0
 	fi
 
Index: debian/src/initscripts/lib/init/mount-functions.sh
===
--- debian/src/initscripts/lib/init/mount-functions.sh	(revision 1953)
+++ debian/src/initscripts/lib/init/mount-functions.sh	(working copy)
@@ -21,8 +21,8 @@
 	which selinuxenabled /dev/null 21  selinuxenabled
 }
 
-
 # Called before mtab is writable 

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

2011-04-01 Thread Roger Leigh
On Fri, Apr 01, 2011 at 02:18:11PM +0100, Roger Leigh wrote:
 On Thu, Mar 31, 2011 at 06:55:16PM +0100, Roger Leigh wrote:
  On Wed, Mar 30, 2011 at 11:00:57PM +0100, Roger Leigh wrote:
   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.
  
  Updated patch attached.  Handles upgrades and reboots; other than
  the one outstanding TODO item (transition of /lib/init/rw from
  directory to symlink, probably something we can leave until after
  squeeze).
 
 Updated patch attached.  This one has been tested in a VM, and will
 allow a machine to boot and transition to /run safely.
 
 Minor outstanding issue:
 /etc/init.d/mountall.sh fails.  This is due to (apparently) / and /proc
 already being mounted, leading to a 32 exit status.  Maybe an mtab
 issue?
 
 In order to work properly with bind mounts on freebsd kernels, I've
 synched domount and domtab logic so that they behave identically.
 However, I'm seeing some odd double bind mounts in /proc/mounts
 and an incomplete /etc/mtab, so there's possibly something not quite
 right here.
 
 Apart from this one issue, everything else is working fully.

Updated patch attached.  This fixes the above outstanding issues.
It should now be safe for general testing and use.

Note: needs versioned base-files dependency adding.


Thanks,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


signature.asc
Description: Digital signature


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

2011-04-01 Thread Roger Leigh
On Fri, Apr 01, 2011 at 03:11:18PM +0100, Roger Leigh wrote:
 On Fri, Apr 01, 2011 at 02:18:11PM +0100, Roger Leigh wrote:
  On Thu, Mar 31, 2011 at 06:55:16PM +0100, Roger Leigh wrote:
   On Wed, Mar 30, 2011 at 11:00:57PM +0100, Roger Leigh wrote:
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.
   
   Updated patch attached.  Handles upgrades and reboots; other than
   the one outstanding TODO item (transition of /lib/init/rw from
   directory to symlink, probably something we can leave until after
   squeeze).
  
  Updated patch attached.  This one has been tested in a VM, and will
  allow a machine to boot and transition to /run safely.
  
  Minor outstanding issue:
  /etc/init.d/mountall.sh fails.  This is due to (apparently) / and /proc
  already being mounted, leading to a 32 exit status.  Maybe an mtab
  issue?
  
  In order to work properly with bind mounts on freebsd kernels, I've
  synched domount and domtab logic so that they behave identically.
  However, I'm seeing some odd double bind mounts in /proc/mounts
  and an incomplete /etc/mtab, so there's possibly something not quite
  right here.
  
  Apart from this one issue, everything else is working fully.
 
 Updated patch attached.  This fixes the above outstanding issues.
 It should now be safe for general testing and use.
 
 Note: needs versioned base-files dependency adding.

Updated patch attached; adds kfreebsd support to initscripts postinst.


-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: debian/src/initscripts/share/default.rcS
===
--- debian/src/initscripts/share/default.rcS	(revision 1953)
+++ debian/src/initscripts/share/default.rcS	(working copy)
@@ -13,5 +13,4 @@
 UTC=yes
 VERBOSE=no
 FSCKFIX=no
-RAMRUN=no
-RAMLOCK=no
+RAMLOCK=yes
Index: debian/src/initscripts/doc/README.Debian
===
--- debian/src/initscripts/doc/README.Debian	(revision 1953)
+++ debian/src/initscripts/doc/README.Debian	(working copy)
@@ -4,15 +4,14 @@
 Tmpfs can be used as virtual memory filesystem. glibc 2.2 and above
 expects a tmpfs to be mounted at /dev/shm for POSIX shared memory,
 this is done automatically by /etc/init.d/mountdevsubfs.sh early in
-the boot process. You can limit tmpfs max size by setting the
-SHM_SIZE variable to a desired size in the /etc/default/tmpfs file
-to prevent tmpfs from using up all system memory.
+the boot process. You can limit tmpfs max size by setting the SHM_SIZE
+variable to a desired size in the /etc/default/tmpfs file to prevent
+tmpfs from using up all system memory.
 
-A tmpfs can also be mounted over /var/run/ and /var/lock/. This can
-be achieved by setting the RAMRUN and RAMLOCK variables to yes in
-the /etc/default/rcS file. A size limit for the tmpfs filesystem
-mounted over /var/run/ and /var/lock/ can be set via the RUN_SIZE
-and LOCK_SIZE variables in the /etc/default/tmpfs file.
+A size limit for the tmpfs filesystem mounted over /run can be set via
+the RUN_SIZE variable in the /etc/default/tmpfs file.  Likewise, a
+size limit for the tmpfs filesystem mounted over /run/lock can be set
+via the LOCK_SIZE variable (if enabled with RAMLOCK=yes).
 
 If TMPFS_SIZE is set in /etc/default/tmpfs, it will be used as the
 default value for SHM_SIZE, RUN_SIZE and LOCK_SIZE. Otherwise, kernel
@@ -22,11 +21,10 @@
 sendsigs process omission interface
 ---
 
-Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs
-is able to omit processes from being killed by killall5(8). Process
-id's listed in /var/run/sendsigs.omit, /lib/init/rw/sendsigs.omit or
-any file in the /lib/init/rw/sendsigs.omit.d/ directory will be
-omitted by sendsigs.
+Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs is
+able to omit processes from being killed by killall5(8). Process id's
+listed in /run/sendsigs.omit, /run/init/sendsigs.omit or any file in
+the /run/init/sendsigs.omit.d/ directory will be omitted by sendsigs.
 
 The recommended practise for adding a process id for omission is to
 create a file in /lib/init/rw/sendsigs.omit.d/package name
Index: debian/src/initscripts/lib/init/bootclean.sh
===
--- debian/src/initscripts/lib/init/bootclean.sh	(revision 1953)
+++ debian/src/initscripts/lib/init/bootclean.sh	(working copy)
@@ -112,7 +112,7 @@
 }
 
 clean_lock() {
-	if [ yes = $RAMLOCK ] ; then
+	if [ -f /var/lock/.ramfs ] ; then
 	return 0
 	fi
 
@@ -136,7 +136,7 @@
 }
 
 clean_run() {
-	if [ yes = $RAMRUN ] ; then
+	if [ -f /var/run/.ramfs ] 

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

2011-04-01 Thread Roger Leigh
On Fri, Apr 01, 2011 at 04:19:03PM +0100, Roger Leigh wrote:
 On Fri, Apr 01, 2011 at 03:11:18PM +0100, Roger Leigh wrote:
  On Fri, Apr 01, 2011 at 02:18:11PM +0100, Roger Leigh wrote:
   On Thu, Mar 31, 2011 at 06:55:16PM +0100, Roger Leigh wrote:
On Wed, Mar 30, 2011 at 11:00:57PM +0100, Roger Leigh wrote:
 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.

Updated patch attached.  Handles upgrades and reboots; other than
the one outstanding TODO item (transition of /lib/init/rw from
directory to symlink, probably something we can leave until after
squeeze).
   
   Updated patch attached.  This one has been tested in a VM, and will
   allow a machine to boot and transition to /run safely.
   
   Minor outstanding issue:
   /etc/init.d/mountall.sh fails.  This is due to (apparently) / and /proc
   already being mounted, leading to a 32 exit status.  Maybe an mtab
   issue?
   
   In order to work properly with bind mounts on freebsd kernels, I've
   synched domount and domtab logic so that they behave identically.
   However, I'm seeing some odd double bind mounts in /proc/mounts
   and an incomplete /etc/mtab, so there's possibly something not quite
   right here.
   
   Apart from this one issue, everything else is working fully.
  
  Updated patch attached.  This fixes the above outstanding issues.
  It should now be safe for general testing and use.
  
  Note: needs versioned base-files dependency adding.
 
 Updated patch attached; adds kfreebsd support to initscripts postinst.

Updated postinst following feedback on #debian-devel:
- use uname rather than dpkg --print-architecture
- simplify conditional logic


-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: debian/src/initscripts/share/default.rcS
===
--- debian/src/initscripts/share/default.rcS	(revision 1953)
+++ debian/src/initscripts/share/default.rcS	(working copy)
@@ -13,5 +13,4 @@
 UTC=yes
 VERBOSE=no
 FSCKFIX=no
-RAMRUN=no
-RAMLOCK=no
+RAMLOCK=yes
Index: debian/src/initscripts/doc/README.Debian
===
--- debian/src/initscripts/doc/README.Debian	(revision 1953)
+++ debian/src/initscripts/doc/README.Debian	(working copy)
@@ -4,15 +4,14 @@
 Tmpfs can be used as virtual memory filesystem. glibc 2.2 and above
 expects a tmpfs to be mounted at /dev/shm for POSIX shared memory,
 this is done automatically by /etc/init.d/mountdevsubfs.sh early in
-the boot process. You can limit tmpfs max size by setting the
-SHM_SIZE variable to a desired size in the /etc/default/tmpfs file
-to prevent tmpfs from using up all system memory.
+the boot process. You can limit tmpfs max size by setting the SHM_SIZE
+variable to a desired size in the /etc/default/tmpfs file to prevent
+tmpfs from using up all system memory.
 
-A tmpfs can also be mounted over /var/run/ and /var/lock/. This can
-be achieved by setting the RAMRUN and RAMLOCK variables to yes in
-the /etc/default/rcS file. A size limit for the tmpfs filesystem
-mounted over /var/run/ and /var/lock/ can be set via the RUN_SIZE
-and LOCK_SIZE variables in the /etc/default/tmpfs file.
+A size limit for the tmpfs filesystem mounted over /run can be set via
+the RUN_SIZE variable in the /etc/default/tmpfs file.  Likewise, a
+size limit for the tmpfs filesystem mounted over /run/lock can be set
+via the LOCK_SIZE variable (if enabled with RAMLOCK=yes).
 
 If TMPFS_SIZE is set in /etc/default/tmpfs, it will be used as the
 default value for SHM_SIZE, RUN_SIZE and LOCK_SIZE. Otherwise, kernel
@@ -22,11 +21,10 @@
 sendsigs process omission interface
 ---
 
-Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs
-is able to omit processes from being killed by killall5(8). Process
-id's listed in /var/run/sendsigs.omit, /lib/init/rw/sendsigs.omit or
-any file in the /lib/init/rw/sendsigs.omit.d/ directory will be
-omitted by sendsigs.
+Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs is
+able to omit processes from being killed by killall5(8). Process id's
+listed in /run/sendsigs.omit, /run/init/sendsigs.omit or any file in
+the /run/init/sendsigs.omit.d/ directory will be omitted by sendsigs.
 
 The recommended practise for adding a process id for omission is to
 create a file in /lib/init/rw/sendsigs.omit.d/package name
Index: debian/src/initscripts/lib/init/bootclean.sh
===
--- debian/src/initscripts/lib/init/bootclean.sh	(revision 1953)
+++ debian/src/initscripts/lib/init/bootclean.sh	(working 

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

2011-04-01 Thread Roger Leigh
On Fri, Apr 01, 2011 at 05:42:53PM +0100, Roger Leigh wrote:
 On Fri, Apr 01, 2011 at 04:19:03PM +0100, Roger Leigh wrote:
  On Fri, Apr 01, 2011 at 03:11:18PM +0100, Roger Leigh wrote:
   On Fri, Apr 01, 2011 at 02:18:11PM +0100, Roger Leigh wrote:
On Thu, Mar 31, 2011 at 06:55:16PM +0100, Roger Leigh wrote:
 On Wed, Mar 30, 2011 at 11:00:57PM +0100, Roger Leigh wrote:
  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.
 
 Updated patch attached.  Handles upgrades and reboots; other than
 the one outstanding TODO item (transition of /lib/init/rw from
 directory to symlink, probably something we can leave until after
 squeeze).

Updated patch attached.  This one has been tested in a VM, and will
allow a machine to boot and transition to /run safely.

Minor outstanding issue:
/etc/init.d/mountall.sh fails.  This is due to (apparently) / and /proc
already being mounted, leading to a 32 exit status.  Maybe an mtab
issue?

In order to work properly with bind mounts on freebsd kernels, I've
synched domount and domtab logic so that they behave identically.
However, I'm seeing some odd double bind mounts in /proc/mounts
and an incomplete /etc/mtab, so there's possibly something not quite
right here.

Apart from this one issue, everything else is working fully.
   
   Updated patch attached.  This fixes the above outstanding issues.
   It should now be safe for general testing and use.
   
   Note: needs versioned base-files dependency adding.
  
  Updated patch attached; adds kfreebsd support to initscripts postinst.
 
 Updated postinst following feedback on #debian-devel:
 - use uname rather than dpkg --print-architecture
 - simplify conditional logic

Updated to
- not enable RAMLOCK by default (though doing so removes a DoS we
  are currently vulnerable to even with traditional /var)
- only use new paths in sendsigs
Thanks to mbiebl for this review.


-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: debian/src/initscripts/share/default.rcS
===
--- debian/src/initscripts/share/default.rcS	(revision 1953)
+++ debian/src/initscripts/share/default.rcS	(working copy)
@@ -13,5 +13,4 @@
 UTC=yes
 VERBOSE=no
 FSCKFIX=no
-RAMRUN=no
 RAMLOCK=no
Index: debian/src/initscripts/doc/README.Debian
===
--- debian/src/initscripts/doc/README.Debian	(revision 1953)
+++ debian/src/initscripts/doc/README.Debian	(working copy)
@@ -4,15 +4,14 @@
 Tmpfs can be used as virtual memory filesystem. glibc 2.2 and above
 expects a tmpfs to be mounted at /dev/shm for POSIX shared memory,
 this is done automatically by /etc/init.d/mountdevsubfs.sh early in
-the boot process. You can limit tmpfs max size by setting the
-SHM_SIZE variable to a desired size in the /etc/default/tmpfs file
-to prevent tmpfs from using up all system memory.
+the boot process. You can limit tmpfs max size by setting the SHM_SIZE
+variable to a desired size in the /etc/default/tmpfs file to prevent
+tmpfs from using up all system memory.
 
-A tmpfs can also be mounted over /var/run/ and /var/lock/. This can
-be achieved by setting the RAMRUN and RAMLOCK variables to yes in
-the /etc/default/rcS file. A size limit for the tmpfs filesystem
-mounted over /var/run/ and /var/lock/ can be set via the RUN_SIZE
-and LOCK_SIZE variables in the /etc/default/tmpfs file.
+A size limit for the tmpfs filesystem mounted over /run can be set via
+the RUN_SIZE variable in the /etc/default/tmpfs file.  Likewise, a
+size limit for the tmpfs filesystem mounted over /run/lock can be set
+via the LOCK_SIZE variable (if enabled with RAMLOCK=yes).
 
 If TMPFS_SIZE is set in /etc/default/tmpfs, it will be used as the
 default value for SHM_SIZE, RUN_SIZE and LOCK_SIZE. Otherwise, kernel
@@ -22,11 +21,10 @@
 sendsigs process omission interface
 ---
 
-Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs
-is able to omit processes from being killed by killall5(8). Process
-id's listed in /var/run/sendsigs.omit, /lib/init/rw/sendsigs.omit or
-any file in the /lib/init/rw/sendsigs.omit.d/ directory will be
-omitted by sendsigs.
+Since initscripts package version 2.86.ds1-48, /etc/init.d/sendsigs is
+able to omit processes from being killed by killall5(8). Process id's
+listed in /run/sendsigs.omit, /run/init/sendsigs.omit or any file in
+the /run/init/sendsigs.omit.d/ directory will be omitted by sendsigs.
 
 The recommended practise for adding a process id for omission is to
 create a file 

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

2011-03-31 Thread Roger Leigh
On Wed, Mar 30, 2011 at 11:00:57PM +0100, Roger Leigh wrote:
 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.

Updated patch attached.  Handles upgrades and reboots; other than
the one outstanding TODO item (transition of /lib/init/rw from
directory to symlink, probably something we can leave until after
squeeze).


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff -urN sysvinit-2.88dsf.original/debian/changelog sysvinit-2.88dsf/debian/changelog
--- sysvinit-2.88dsf.original/debian/changelog	2011-03-30 16:46:27.675265266 +0100
+++ sysvinit-2.88dsf/debian/changelog	2011-03-31 18:52:52.398709945 +0100
@@ -1,3 +1,83 @@
+sysvinit (2.88dsf-14) unstable; urgency=low
+
+  * Support for new top-level directory /run to replace /var/run,
+/var/lock and /lib/init/rw as a place to store transient
+writable data which should not be preserved across a system
+reboot.  Summary:
+  /var/run → /run
+  /var/lock → /run/lock
+  /lib/init/rw → /run/init
+These changes do not take effect until the system is rebooted as
+is currently done for /lib/init/rw setup.  Following a reboot, the
+old paths will continue to be available via bind mounts.  For
+wheezy, packages must continue to use the existing paths because
+/run is not guaranteed to be present.  In wheezy+1, all paths under
+/run can be relied upon, and the old paths can be switched to be
+symlinks (maybe only for clean installs?) or kept as bind mounts.
+- initscripts.postinst:
+  Trigger reboot to complete transition.
+  If the system has not yet transitioned to a tmpfs-based /run, set up
+  bind mounts as follows:
+/var/run → /run
+/var/lock → /run/lock
+/lib/init/rw → /run/init
+  On reboot, the system will complete the migration to a tmpfs-based
+  /run; this creates the directory heierachy from the old paths to
+  enable the use of the new /run paths prior to a restart.  This means
+  packages may transition to using /run with a versioned dependency
+  upon initscripts, rather than waiting for the release of wheezy.
+  Remove special handling for RAMRUN and RAMLOCK, which is now taken
+  care of by /run.
+- debian/src/initscripts/doc/README.Debian:
+  Document new use of RUN_SIZE and LOCK_SIZE.
+  Refer to /run/init rather than /lib/init/rw.
+- debian/src/initscripts/etc/init.d/checkroot.sh:
+  Use /run/init in place of /lib/init/rw.
+- debian/src/initscripts/etc/init.d/mountkernfs.sh:
+  Create /run/init, /run/init/sendsigs.omit.d and /run/lock.
+  Bind mount /run/init to /lib/init/rw for backward compatibility.
+  Mount /run/lock as a separate tmpfs if RAMLOCK=yes.
+  /run/lock has 01777 permissions to match /var/lock.
+  Drop mounting of /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/mtab.sh:
+  Bind mount /run/init and drop mounting of /var/run.  Mount /run/lock
+  in place of /var/lock.
+- debian/src/initscripts/etc/init.d/sendsigs:
+  Support both old and new paths:
+files: /run/sendsigs.omit /run/init/sendsigs.omit
+   /var/run/sendsigs.omit /lib/init/rw/sendsigs.omit
+dirs: /run/init/sendsigs.omit.d/ /lib/init/rw/sendsigs.omit.d/
+  Support for both is required to allow clean shutdown of systems
+  both after an upgrade but before reboot (old paths) and after an
+  upgrade after reboot (new paths).
+- debian/src/initscripts/etc/init.d/umountfs:
+  Ignore /run.  Continue to ignore /lib/init/rw in order to handle
+  clean shutdown.  Also continue to ignore /var/run and /var/lock
+  Check for presence of .ramfs than configuration variable when
+  skipping /var/run and /var/lock.
+- debian/src/initscripts/etc/init.d/umountnfs.sh:
+  Check for presence of .ramfs than configuration variable when
+  skipping /var/run and /var/lock.
+  Ignore /run.  Continue to ignore /lib/init/rw in order to handle
+  clean shutdown.  Also continue to ignore /var/run and /var/lock
+  if mounted as tmpfs in order to cleanly shutdown.
+- debian/src/initscripts/lib/init/bootclean.sh
+  Check for presence of .ramfs than configuration variable when
+  cleaning /var/run and /var/lock.
+- debian/src/initscripts/lib/init/mount-functions.sh:
+  Drop support for mounting /var/run and /var/lock as separate
+  tmpfs filesystems.  Symlink /var/run to /run and /var/lock to
+  /run/lock if possible.  If /var/run and /var/lock are directories,
+  attempt to remove and symlink if successful, or else bind mount.
+- 

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

2011-03-30 Thread Roger Leigh
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-1GNU core utilities
ii  debianutils 3.4.4Miscellaneous utilities specific t
ii  libc6   2.11.2-13Embedded GNU C Library: Shared lib
ii  lsb-base3.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  psmisc22.13-1utilities that use the proc file s

initscripts suggests no packages.

-- no debconf information
diff -urN sysvinit-2.88dsf.original/debian/changelog sysvinit-2.88dsf/debian/changelog
--- sysvinit-2.88dsf.original/debian/changelog	2011-03-30 16:46:27.675265266 +0100
+++ sysvinit-2.88dsf/debian/changelog	2011-03-30 22:29:57.414026872 +0100
@@ -1,3 +1,68 @@
+sysvinit (2.88dsf-14) unstable; urgency=low
+
+  * Support for new top-level directory /run to replace /var/run,
+/var/lock and /lib/init/rw as a place to store transient
+writable data which should not be preserved across a system
+reboot.  Summary:
+  /var/run → /run
+  /var/lock → /run/lock
+  /lib/init/rw → /run/init
+These changes do not take effect until the