Your message dated Sat, 16 Apr 2011 16:08:33 +0000
with message-id <[email protected]>
and subject line Bug#620191: fixed in sysvinit 2.88dsf-13.3
has caused the Debian Bug report #620191,
regarding initscripts: [patch] Please support top-level /run
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
620191: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620191
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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
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 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.
+ - debian/src/initscripts/doc/README.Debian:
+ Document new use of RUN_SIZE; LOCK_SIZE is no longer used.
+ 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.
+ /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 and /var/lock.
+ TODO: Does this exactly match the mountkernfs behaviour?
+ - 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/umountnfs.sh:
+ 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/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.
+ - debian/src/initscripts/Makefile: /lib/init/rw is created as a
+ symlink to /run.
+ TODO: Given that it's a directory and in use as a mountpoint on
+ upgrades, this probably won't work. Maybe create as a symlink
+ for new installs only. Since /lib might be read only, we can't
+ assume that we can change it at boot time.
+ * TODO: /run/lock and /var/lock have 01777 permissions, which means
+ there is a potential for any user to DoS the system by filling
+ either /var or /run. We should investigate why this is the case.
+ Other distributions use a lock group and setgid binaries, but this
+ may cause its own problems. We could always use a tiny tmps
+ mounted separately on /run/lock.
+ * TODO: Handling upgrades. The above changes only take effect upon
+ rebooting the system, and do not set up /run on upgrade. We could
+ use mount --bind/--move to move things around on upgrade to allow
+ a more immediate transition.
+
+ -- Roger Leigh <[email protected]> Wed, 30 Mar 2011 21:17:49 +0100
+
sysvinit (2.88dsf-13.1) unstable; urgency=low
* Non-maintainer upload.
diff -urN sysvinit-2.88dsf.original/debian/initscripts.postinst sysvinit-2.88dsf/debian/initscripts.postinst
--- sysvinit-2.88dsf.original/debian/initscripts.postinst 2011-03-30 16:46:27.675265266 +0100
+++ sysvinit-2.88dsf/debian/initscripts.postinst 2011-03-30 21:17:27.714566966 +0100
@@ -143,13 +143,13 @@
fi
#
-# When installing for the first time or upgrading from version before
-# 2.86.ds1-27, a reboot is needed to make the /lib/init/rw/ tmpfs
-# available. Flag this using notify-reboot-required. Not mounting it
-# here as it creates problem for debootstrap, vservers, pbuilder and
-# cowbuilder.
+# When installing for the first time or upgrading from a version
+# before or equal to 2.88dsf-14, a reboot is needed to make the /run
+# tmpfs available. Flag this using notify-reboot-required. Not
+# mounting it here as it creates problem for debootstrap, vservers,
+# pbuilder and cowbuilder.
#
-if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-27" \
+if dpkg --compare-versions "$PREV_VER" le "2.88dsf-14" \
&& [ -x /usr/share/update-notifier/notify-reboot-required ]; then
/usr/share/update-notifier/notify-reboot-required
fi
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/doc/README.Debian sysvinit-2.88dsf/debian/src/initscripts/doc/README.Debian
--- sysvinit-2.88dsf.original/debian/src/initscripts/doc/README.Debian 2011-03-30 16:46:27.675265266 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/doc/README.Debian 2011-03-30 21:24:29.643799146 +0100
@@ -4,29 +4,25 @@
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.
-
-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.
+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 size limit for the tmpfs filesystem mounted over /run can be set via
+the RUN_SIZE variable in the /etc/default/tmpfs file.
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
-defaults are used.
+default value for SHM_SIZE and RUN_SIZE. Otherwise, kernel defaults
+are used.
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>
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/etc/default/tmpfs sysvinit-2.88dsf/debian/src/initscripts/etc/default/tmpfs
--- sysvinit-2.88dsf.original/debian/src/initscripts/etc/default/tmpfs 2011-03-30 16:46:27.679265316 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/default/tmpfs 2011-03-30 20:29:06.406325953 +0100
@@ -1,6 +1,14 @@
+# TMPFS_SIZE sets the maximum size (in bytes) that tmpfs filesystems can use.
+#
+# The size will be rounded down to a multiple of the page size, 4096 bytes.
+TMPFS_SIZE=
+
# SHM_SIZE sets the maximum size (in bytes) that the /dev/shm tmpfs can use.
# If this is not set then the size defaults to the value of TMPFS_SIZE
# if that is set; otherwise to the kernel's default.
-#
-# The size will be rounded down to a multiple of the page size, 4096 bytes.
SHM_SIZE=
+
+# RUN_SIZE sets the maximum size (in bytes) that the /run tmpfs can use.
+# If this is not set then the size defaults to the value of TMPFS_SIZE
+# if that is set; otherwise to the kernel's default.
+RUN_SIZE=
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/checkroot.sh sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/checkroot.sh
--- sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/checkroot.sh 2011-03-30 16:46:27.675265266 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/checkroot.sh 2011-03-30 21:25:53.340835041 +0100
@@ -137,7 +137,7 @@
#
# Does the root device in /etc/fstab match with the actual device ?
# If not we try to use the /dev/root alias device, and if that
- # fails we create a temporary node in /lib/init/rw.
+ # fails we create a temporary node in /run/init.
#
if [ "$rootcheck" = yes ]
then
@@ -150,11 +150,11 @@
rootdev=/dev/root
else
if \
- rm -f /lib/init/rw/rootdev \
- && mknod -m 600 /lib/init/rw/rootdev b ${rdev%:*} ${rdev#*:} \
- && [ -e /lib/init/rw/rootdev ]
+ rm -f /run/init/rootdev \
+ && mknod -m 600 /run/init/rootdev b ${rdev%:*} ${rdev#*:} \
+ && [ -e /run/init/rootdev ]
then
- rootdev=/lib/init/rw/rootdev
+ rootdev=/run/init/rootdev
else
rootfatal=yes
fi
@@ -169,7 +169,7 @@
then
log_failure_msg "The device node $rootdev for the root filesystem is missing or incorrect
or there is no entry for the root filesystem listed in /etc/fstab.
-The system is also unable to create a temporary node in /lib/init/rw.
+The system is also unable to create a temporary node in /run/init.
This means you have to fix the problem manually."
log_warning_msg "A maintenance shell will now be started.
CONTROL-D will terminate this shell and restart the system."
@@ -268,7 +268,7 @@
then
log_action_begin_msg "Checking root file system"
if [ "$roottype" = "ext2" -o "$roottype" = "ext3" -o "$roottype" = "ext4" ] && usplash_running; then
- PROGRESS_FILE=`mktemp -p /lib/init/rw` || PROGRESS_FILE=/lib/init/rw/checkroot_fsck
+ PROGRESS_FILE=`mktemp -p /run/init` || PROGRESS_FILE=/run/init/checkroot_fsck
set -m
logsave -s $FSCK_LOGFILE fsck -C3 $force $fix -t $roottype $rootdev >/dev/console 2>&1 3>$PROGRESS_FILE &
set +m
@@ -385,9 +385,9 @@
fi
#
- # Remove /lib/init/rw/rootdev if we created it.
+ # Remove /run/init/rootdev if we created it.
#
- rm -f /lib/init/rw/rootdev
+ rm -f /run/init/rootdev
}
do_status () {
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/mountkernfs.sh sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mountkernfs.sh
--- sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/mountkernfs.sh 2011-03-30 16:46:27.679265316 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mountkernfs.sh 2011-03-30 21:54:22.266746112 +0100
@@ -26,11 +26,24 @@
#
RW_OPT=
[ "${RW_SIZE:=$TMPFS_SIZE}" ] && RW_OPT=",size=$RW_SIZE"
- domount tmpfs "" /lib/init/rw tmpfs -omode=0755,nosuid$RW_OPT
- touch /lib/init/rw/.ramfs
+ domount tmpfs "" /run tmpfs -omode=0755,nosuid$RW_OPT
+ touch /run/.ramfs
+
+ # Make lock directory as the replacement for /var/lock
+ mkdir /run/lock
+ chmod 01777 /run/lock
+
+ # Make init directory as the replacement for /lib/init/rw
+ mkdir /run/init
# Make pidfile omit directory for sendsigs
- mkdir /lib/init/rw/sendsigs.omit.d/
+ # TODO: Move to /run/sendsigs.omit.d? Keeping it in /run/init
+ # keeps compatibility with the existing use of /lib/init/rw.
+ mkdir /run/init/sendsigs.omit.d/
+
+ # Create compatibility bind mount for /lib/init/rw from /run/init
+ [ -d /lib/init/rw ]
+ domount none /run/init /lib/init/rw -orw,bind
#
# Mount proc filesystem on /proc
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/mtab.sh sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mtab.sh
--- sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/mtab.sh 2011-03-30 16:46:27.679265316 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mtab.sh 2011-03-30 21:53:15.213884244 +0100
@@ -107,24 +107,14 @@
# S02mountkernfs.sh
RW_OPT=
- [ "${RW_SIZE:=$TMPFS_SIZE}" ] && RW_OPT=",size=$RW_SIZE"
- domtab tmpfs /lib/init/rw tmpfs -omode=0755,nosuid$RW_OPT
-
+ [ "${RW_SIZE:=$RUN_SIZE}" ] && RW_OPT=",size=$RW_SIZE"
+ domtab tmpfs /run tmpfs -omode=0755,nosuid$RW_OPT
+ domtab /run /lib/init/rw none -orw,bind
domtab proc /proc "proc" -onodev,noexec,nosuid
if grep -E -qs "sysfs\$" /proc/filesystems
then
domtab sysfs /sys sysfs -onodev,noexec,nosuid
fi
- if [ yes = "$RAMRUN" ] ; then
- RUN_OPT=
- [ "${RUN_SIZE:=$TMPFS_SIZE}" ] && RUN_OPT=",size=$RUN_SIZE"
- domtab tmpfs /var/run "varrun" -omode=0755,nosuid$RUN_OPT
- fi
- if [ yes = "$RAMLOCK" ] ; then
- LOCK_OPT=
- [ "${LOCK_SIZE:=$TMPFS_SIZE}" ] && LOCK_OPT=",size=$LOCK_SIZE"
- domtab tmpfs /var/lock "varlock" -omode=1777,nodev,noexec,nosuid$LOCK_OPT
- fi
if [ -d /proc/bus/usb ]
then
domtab usbfs /proc/bus/usb "procbususb"
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/sendsigs sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/sendsigs
--- sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/sendsigs 2011-03-30 16:46:27.679265316 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/sendsigs 2011-03-30 22:13:11.125172850 +0100
@@ -27,9 +27,7 @@
do_stop () {
OMITPIDS=
- # The /var/run/sendsigs.omit file is used to be compatible
- # with Ubuntu.
- for omitfile in /var/run/sendsigs.omit /lib/init/rw/sendsigs.omit; do
+ for omitfile in /run/sendsigs.omit /run/init/sendsigs.omit /var/run/sendsigs.omit /lib/init/rw/sendsigs.omit; do
if [ -e $omitfile ]; then
for pid in $(cat $omitfile); do
OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
@@ -40,8 +38,8 @@
# Load sendsigs.omit.d/packagename files too, to make it
# possible for scripts that need to modify the list of pids at
# run time without race conditions.
- if [ -d /lib/init/rw/sendsigs.omit.d/ ]; then
- for pidfile in /lib/init/rw/sendsigs.omit.d/*; do
+ if [ -d /run/init/sendsigs.omit.d/ ]; then
+ for pidfile in /run/init/sendsigs.omit.d/*; do
[ -f "$pidfile" ] || continue
for pid in $(cat $pidfile); do
OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/#sendsigs# sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/#sendsigs#
--- sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/#sendsigs# 1970-01-01 01:00:00.000000000 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/#sendsigs# 2011-03-30 22:16:10.755473396 +0100
@@ -0,0 +1,126 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: sendsigs
+# Required-Start:
+# Required-Stop: umountnfs
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Kill all remaining processes.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+. /lib/lsb/init-functions
+
+# Make it possible to see who the misbehaving processes are
+report_unkillable() {
+ if [ -x /usr/bin/pstree ] ; then
+ echo "Currently running processes (pstree):"
+ pstree
+ elif [ -x /bin/ps ] ; then
+ echo "Currently running processes (ps):"
+ ps -ef
+ fi
+}
+
+do_stop () {
+ OMITPIDS=
+
+ for omitfile in /run/sendsigs.omit /run/init/sendsigs.omit /var/run/sendsigs.omit /lib/init/rw/sendsigs.omit; do
+ if [ -e $omitfile ]; then
+ for pid in $(cat $omitfile); do
+ OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
+ done
+ fi
+ done
+
+ # Load sendsigs.omit.d/packagename files too, to make it
+ # possible for scripts that need to modify the list of pids at
+ # run time without race conditions.
+ for omitdir in /run/init/sendsigs.omit.d/ /lib/init/rw/sendsigs.omit.d/; do
+
+ if [ -d $omitdir ]; then
+ for pidfile in $omitdir/*; do
+ [ -f "$pidfile" ] || continue
+ for pid in $(cat $pidfile); do
+ OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
+ done
+ done
+ fi
+
+ # Upstart jobs have their own "stop on" clauses that sends
+ # SIGTERM/SIGKILL just like this, so if they're still running,
+ # they're supposed to be
+ if [ -x /sbin/initctl ]; then
+ for pid in $(initctl list | sed -n -e "/process [0-9]/s/.*process //p"); do
+ OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
+ done
+ fi
+
+ # Flush the kernel I/O buffer before we start to kill
+ # processes, to make sure the IO of already stopped services to
+ # not slow down the remaining processes to a point where they
+ # are accidentily killed with SIGKILL because they did not
+ # manage to shut down in time.
+ sync
+
+ # Kill all processes.
+ log_action_begin_msg "Asking all remaining processes to terminate"
+ killall5 -15 $OMITPIDS # SIGTERM
+ log_action_end_msg 0
+ alldead=""
+ for seq in 1 2 3 4 5 6 7 8 9 10; do
+ # use SIGCONT/signal 18 to check if there are
+ # processes left. No need to check the exit code
+ # value, because either killall5 work and it make
+ # sense to wait for processes to die, or it fail and
+ # there is nothing to wait for.
+
+ # did an upstart job start since we last polled initctl? check
+ # again on each loop and add any new jobs (e.g., plymouth) to
+ # the list. If we did miss one starting up, this beats waiting
+ # 10 seconds before shutting down.
+ if [ -x /sbin/initctl ]; then
+ for pid in $(initctl list | sed -n -e "/process [0-9]/s/.*process //p"); do
+ OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
+ done
+ fi
+ if killall5 -18 $OMITPIDS ; then
+ :
+ else
+ alldead=1
+ break
+ fi
+
+ sleep 1
+ done
+ if [ -z "$alldead" ] ; then
+ report_unkillable
+ log_action_begin_msg "Killing all remaining processes"
+ killall5 -9 $OMITPIDS # SIGKILL
+ log_action_end_msg 1
+ else
+ log_action_begin_msg "All processes ended within $seq seconds."
+ log_action_end_msg 0
+ fi
+}
+
+case "$1" in
+ start)
+ # No-op
+ ;;
+ restart|reload|force-reload)
+ echo "Error: argument '$1' not supported" >&2
+ exit 3
+ ;;
+ stop)
+ do_stop
+ ;;
+ *)
+ echo "Usage: $0 start|stop" >&2
+ exit 3
+ ;;
+esac
+
+:
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/umountnfs.sh sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/umountnfs.sh
--- sysvinit-2.88dsf.original/debian/src/initscripts/etc/init.d/umountnfs.sh 2011-03-30 16:46:27.679265316 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/umountnfs.sh 2011-03-30 17:51:05.979695304 +0100
@@ -48,7 +48,7 @@
while read -r DEV MTPT FSTYPE OPTS REST
do
case "$MTPT" in
- /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys|/lib/init/rw)
+ /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys|/run|/lib/init/rw)
continue
;;
/var/run)
diff -urN sysvinit-2.88dsf.original/debian/src/initscripts/lib/init/mount-functions.sh sysvinit-2.88dsf/debian/src/initscripts/lib/init/mount-functions.sh
--- sysvinit-2.88dsf.original/debian/src/initscripts/lib/init/mount-functions.sh 2011-03-30 16:46:27.675265266 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/lib/init/mount-functions.sh 2011-03-30 17:14:44.064097020 +0100
@@ -41,7 +41,7 @@
*) FSTYPE=procfs ;;
esac
elif [ "$1" = tmpfs ]
- then # always accept tmpfs, to mount /lib/init/rw before /proc
+ then # always accept tmpfs, to mount /run before /proc
FSTYPE=$1
elif grep -E -qs "$1\$" /proc/filesystems
then
@@ -136,30 +136,13 @@
}
#
-# Restore /var/run and /var/lock mountpoints if something was mounted
-# as /var/. Avoid mounting them back over themselves if nothing was
-# mounted as /var/ by checking if /var/run/ and /var/lock/ are still
-# mount points. Enabling RAMRUN and RAMLOCK while listing /var/run or
-# /var/lock in /etc/fstab is not supported.
+# For compatibility, create /var/run and /var/lock symlinks to /run
+# and /run/lock, respectively.
#
post_mountall ()
{
- if [ yes = "$RAMRUN" ] ; then
- [ -d /var/run ] || mkdir /var/run
- if mountpoint -q /var/run ; then
- umount /lib/init/rw/var.run
- else
- mount -n --move /lib/init/rw/var.run /var/run
- fi
- rmdir /lib/init/rw/var.run
- fi
- if [ yes = "$RAMLOCK" ] ; then
- [ -d /var/lock ] || mkdir /var/lock
- if mountpoint -q /var/lock ; then
- umount /lib/init/rw/var.lock
- else
- mount -n --move /lib/init/rw/var.lock /var/lock
- fi
- rmdir /lib/init/rw/var.lock
- fi
+ [ -d /var/run ] && rm -fr /var/run
+ ln -fs /run /var/run
+ [ -d /var/lock ] && rm -fr /var/lock
+ ln -fs /run/lock /var/lock
}
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
$(INSTALL) -d $(DESTDIR)/var/lib/initscripts/.
$(INSTALL) -d $(DESTDIR)/var/lib/urandom/.
$(INSTALL) -d $(DESTDIR)/var/log/fsck/.
--- End Message ---
--- Begin Message ---
Source: sysvinit
Source-Version: 2.88dsf-13.3
We believe that the bug you reported is fixed in the latest version of
sysvinit, which is due to be installed in the Debian FTP archive:
initscripts_2.88dsf-13.3_amd64.deb
to main/s/sysvinit/initscripts_2.88dsf-13.3_amd64.deb
sysv-rc_2.88dsf-13.3_all.deb
to main/s/sysvinit/sysv-rc_2.88dsf-13.3_all.deb
sysvinit-utils_2.88dsf-13.3_amd64.deb
to main/s/sysvinit/sysvinit-utils_2.88dsf-13.3_amd64.deb
sysvinit_2.88dsf-13.3.diff.gz
to main/s/sysvinit/sysvinit_2.88dsf-13.3.diff.gz
sysvinit_2.88dsf-13.3.dsc
to main/s/sysvinit/sysvinit_2.88dsf-13.3.dsc
sysvinit_2.88dsf-13.3_amd64.deb
to main/s/sysvinit/sysvinit_2.88dsf-13.3_amd64.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Roger Leigh <[email protected]> (supplier of updated sysvinit package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Format: 1.8
Date: Sat, 16 Apr 2011 01:17:29 +0100
Source: sysvinit
Binary: sysvinit sysvinit-utils sysv-rc initscripts
Architecture: source amd64 all
Version: 2.88dsf-13.3
Distribution: experimental
Urgency: low
Maintainer: Debian sysvinit maintainers
<[email protected]>
Changed-By: Roger Leigh <[email protected]>
Description:
initscripts - scripts for initializing and shutting down the system
sysv-rc - System-V-like runlevel change mechanism
sysvinit - System-V-like init utilities
sysvinit-utils - System-V-like utilities
Closes: 186892 353943 378776 406685 423405 481546 483643 503805 530582 564635
585543 599241 599734 607136 612594 616571 620191 620735
Changes:
sysvinit (2.88dsf-13.3) experimental; urgency=low
.
[ Roger Leigh ]
* Non-maintainer upload.
* Support for new top-level directory /run to replace /var/run,
/var/lock, /dev/shm 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. /tmp may also be configured to use /run directly if
it is symlinked to /run/tmp, for example.
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/firmlink mounts, depending on
the platform. Following a reboot, the old paths will be converted to
symlinks, or bind/nullfs/firmlink 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). Add detection logic for vserver environments and Hurd.
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, just create symlinks from the new names
to the existing locations, since otherwise the changes would be
lost, and since rcS scripts aren't run the transition won't
complete.
- 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.
Mount /run/shm if RAMSHM=yes.
- 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. No longer ignore /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. No longer ignore /var/run and /var/lock.
- debian/src/initscripts/lib/init/bootclean.sh
Don't clean /var/run and /var/lock (Closes: #378776). Because
these directories are now a tmpfs, cleaning no longer makes sense.
- debian/src/initscripts/lib/init/tmpfs.sh:
Read /etc/default/tmpfs and provide defaults if unset.
- debian/src/initscripts/lib/init/mount-functions.sh:
Support bind mounts in domount() (Closes: #353943).
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.
- debian/src/initscripts/lib/init/vars.sh:
Read /etc/default/rcS and provide defaults if unset.
- debian/src/initscripts/man/rcS.5:
Drop documentation of RAMRUN.
Update documentation for RAMLOCK (Closes: #406685).
Document RAMTMP and RAMSHM.
- debian/src/initscripts/share/default.rcS:
Remove RAMRUN.
Add RAMSHM and RAMTMP.
RAMLOCK, RAMSHM and RAMTMP default to enabled for new installs.
.
[ Michael Biebl ]
* Remove dead usplash support code (Closes: #599241, #599734, #612594).
.
[ Martin F. Krafft ]
* Add comments to /etc/default/rcS (Closes: #530582).
.
[ Samuel Thibault ]
Hurd portability for initscripts postinst and init scripts.
Hurd does not currently support tmpfs mounts, but will do in the
future. Use firmlinks in place of bind mounts.
Checksums-Sha1:
be9d988363ea206734abf37e28aa05c0e6562b4e 1532 sysvinit_2.88dsf-13.3.dsc
de3efda313a5c2f31d54eadeeff76b161da65156 172561 sysvinit_2.88dsf-13.3.diff.gz
b78268833a44e50f9cd3e2f9c973e586e1950092 123172 sysvinit_2.88dsf-13.3_amd64.deb
124dd7d5976ab932b12836aa034285adf38ebadc 123756
sysvinit-utils_2.88dsf-13.3_amd64.deb
549bda85e582e268f0c845f510af1f15c0a78e23 75664
initscripts_2.88dsf-13.3_amd64.deb
b2825862ee97b31ff274955be71a231546dd7c83 76464 sysv-rc_2.88dsf-13.3_all.deb
Checksums-Sha256:
07d58ffae680f2875127b9192a7e2d9e4ac5d43df44592d5c353992e869352a6 1532
sysvinit_2.88dsf-13.3.dsc
661a477552f9be1a0f1f112b392a0f18f6007ca5490fc94079c771f90671cfcf 172561
sysvinit_2.88dsf-13.3.diff.gz
4c1472aef05058062225daddf11d4390824a73b7bdea886508b26b1f6722495f 123172
sysvinit_2.88dsf-13.3_amd64.deb
7990833fcea2c8b52bf91f7e2dfce748ec285270926aa2f86ffc3dcf8e9881fd 123756
sysvinit-utils_2.88dsf-13.3_amd64.deb
5f9af575d548648a96c07412df3c4a83fde14575b3cc714b16203211736795b2 75664
initscripts_2.88dsf-13.3_amd64.deb
dd1393d8206bb5b320d42f92b100636108396edb59fb993a69823aea04cae57a 76464
sysv-rc_2.88dsf-13.3_all.deb
Files:
ce5a50face05beafa6cab9642a0bb95a 1532 admin required sysvinit_2.88dsf-13.3.dsc
6dbe29e91350698e63857ae24de5ffbf 172561 admin required
sysvinit_2.88dsf-13.3.diff.gz
7518abcfd4f81b48129b56d32e0ae9a8 123172 admin required
sysvinit_2.88dsf-13.3_amd64.deb
9a672f235a3a1cae9b0435ee3397c41c 123756 admin required
sysvinit-utils_2.88dsf-13.3_amd64.deb
281d99c48bda7dd1abf32b74c5f91ab2 75664 admin required
initscripts_2.88dsf-13.3_amd64.deb
c802c38a538c6e39e05b6d079833e4f9 76464 admin required
sysv-rc_2.88dsf-13.3_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEAREDAAYFAk2puNAACgkQVcFcaSW/uEgMKwCg7OelUXpt8gjS5XCQJ6fdnL8N
cvMAniD5GrfZsHPB8tn1OIkv3OQNnDoB
=KEGe
-----END PGP SIGNATURE-----
--- End Message ---
_______________________________________________
Pkg-sysvinit-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-sysvinit-devel