Bug#699019: unblock: sysvinit/2.88dsf-38
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package sysvinit
Bugs closed:
#694961: Don't break boot with older upstart versions
#694252: Break older bootchart versions to allow migration to
dependency-based boot
#694379: Work around a bug in the Oracle database which has a
buggy check for /dev/shm
#697537: Correct buggy check for /dev/shm
#697994: Remove all use of heredocs (not safe until /tmp is writable)
#663009: Default to PID1 when determining PID of init so that the
init process is correctly restarted on upgrade
And fix globbing in /etc/fstab.d (no bug number).
Thanks,
Roger
diff -Nru sysvinit-2.88dsf/debian/changelog sysvinit-2.88dsf/debian/changelog
--- sysvinit-2.88dsf/debian/changelog 2012-11-16 20:51:07.000000000 +0000
+++ sysvinit-2.88dsf/debian/changelog 2013-01-24 21:33:09.000000000 +0000
@@ -1,3 +1,50 @@
+sysvinit (2.88dsf-38) unstable; urgency=low
+
+ [ Roger Leigh ]:
+ * If pidof fails in the sysvinit postinst or initscripts, default
+ to PID 1 (for /sbin/init) (Closes: #663009).
+ * Make fstab globbing in initscripts completely robust.
+
+ -- Roger Leigh <rleigh@debian.org> Wed, 23 Jan 2013 22:43:55 +0000
+
+sysvinit (2.88dsf-37) unstable; urgency=low
+
+ [ Roger Leigh ]
+ * initscripts: Remove all use of shell heredocs in shell libraries;
+ these require a writable /tmp which will not be guaranteed to be
+ present in early boot (Closes: #697994).
+
+ -- Roger Leigh <rleigh@debian.org> Mon, 14 Jan 2013 21:53:59 +0000
+
+sysvinit (2.88dsf-36) unstable; urgency=low
+
+ [ Roger Leigh ]
+ * initscripts:
+ - Handle globbing of /etc/fstab.d/* safely.
+ - Correct erroneous error that an entry for /dev/shm existed in
+ /etc/fstab when no entry was present (Closes: #697537).
+
+ -- Roger Leigh <rleigh@debian.org> Fri, 11 Jan 2013 23:36:28 +0000
+
+sysvinit (2.88dsf-35) unstable; urgency=low
+
+ [ David Prévot ]
+ * Fix German translation charset.
+
+ [ Roger Leigh ]
+ * initscripts:
+ - To permit enabling of dependency-based boot, add Breaks on older
+ versions of bootchart. Thanks to Andreas Beckmann.
+ Closes: #694252.
+ - To work around a bug in the Oracle database, which has a faulty
+ check for /dev/shm, continue to mount a tmpfs on /dev/shm rather
+ than /run/shm if one is defined in /etc/fstab. Closes: #694379.
+ * sysvinit-utils:
+ - Add Breaks: upstart (<< 1.5-1) to avoid breaking the boot with
+ older versions of upstart. Closes: #694961.
+
+ -- Roger Leigh <rleigh@debian.org> Mon, 17 Dec 2012 22:50:49 +0000
+
sysvinit (2.88dsf-34) unstable; urgency=low
[ Roger Leigh ]
diff -Nru sysvinit-2.88dsf/debian/control sysvinit-2.88dsf/debian/control
--- sysvinit-2.88dsf/debian/control 2012-08-31 21:14:04.000000000 +0100
+++ sysvinit-2.88dsf/debian/control 2012-12-17 22:37:45.000000000 +0000
@@ -42,6 +42,7 @@
Conflicts: last, sysvconfig, chkconfig (<< 11.0-79.1-2)
Replaces: last, sysvinit (<= 2.86.ds1-65)
Depends: ${shlibs:Depends}, ${misc:Depends}
+Breaks: upstart (<< 1.5-1)
Suggests: bootlogd, sash
Description: System-V-like utilities
This package contains the important System-V-like utilities.
@@ -74,7 +75,8 @@
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)
+Conflicts:
+ libdevmapper1.02.1 (<< 2:1.02.24-1),
Replaces: libc6, libc6.1, libc0.1, libc0.3
Breaks:
# Needed for ifquery
@@ -112,7 +114,9 @@
autofs (<< 5.0.0),
# Older versions of initramfs-tools can't cope with /etc/mtab
# being a symlink #668616 and #668650
- initramfs-tools (<< 0.104)
+ initramfs-tools (<< 0.104),
+# Needed for transition to dependency-based boot for wheezy
+ bootchart (<< 0.10~svn407-3.3)
Description: scripts for initializing and shutting down the system
The scripts in this package initialize a standard Debian
system at boot time and shut it down at halt or reboot time.
diff -Nru sysvinit-2.88dsf/debian/po/de.po sysvinit-2.88dsf/debian/po/de.po
--- sysvinit-2.88dsf/debian/po/de.po 2012-08-31 21:14:04.000000000 +0100
+++ sysvinit-2.88dsf/debian/po/de.po 2012-12-10 23:03:45.000000000 +0000
@@ -21,7 +21,7 @@
#: ../sysv-rc.templates:1001
msgid "Unable to migrate to dependency-based boot system"
msgstr ""
-"Es konnte nicht auf abhängigkeitsbasierte Systemstartreihenfolge umgestellt "
+"Es konnte nicht auf abhängigkeitsbasierte Systemstartreihenfolge umgestellt "
"werden."
#. Type: note
@@ -32,7 +32,7 @@
"dependency-based boot sequencing:"
msgstr ""
"Im Startsystem gibt es Probleme, die eine Umstellung auf "
-"abhängigkeitsbasierte Systemstartreihenfolge verhindern:"
+"abhängigkeitsbasierte Systemstartreihenfolge verhindern:"
#. Type: note
#. Description
@@ -43,10 +43,10 @@
"package has been removed, but not purged. It is suggested that these are "
"removed by running:"
msgstr ""
-"Falls das gemeldete Problem von einer lokalen Ãnderung rührt, muss es manuell "
+"Falls das gemeldete Problem von einer lokalen Änderung rührt, muss es manuell "
"behoben werden. Dies sind normalerweise veraltete Conffiles, die "
-"zurückgeblieben sind, als ein Paket gelöscht, aber nicht vollständig entfernt "
-"wurde. Es wird empfohlen, diese zu entfernen, indem Folgendes ausgeführt wird:"
+"zurückgeblieben sind, als ein Paket gelöscht, aber nicht vollständig entfernt "
+"wurde. Es wird empfohlen, diese zu entfernen, indem Folgendes ausgeführt wird:"
#. Type: note
#. Description
@@ -63,5 +63,5 @@
"fixed, run \"dpkg --configure sysv-rc\"."
msgstr ""
"Die Paketinstallation kann nicht fortgesetzt werden, bis obige Probleme "
-"behoben wurde. Um den Umstellungsprozess nach dem Lösen dieser Probleme "
-"erneut zu versuchen, führen Sie »dpkg --configure sysv-rc« aus."
+"behoben wurde. Um den Umstellungsprozess nach dem Lösen dieser Probleme "
+"erneut zu versuchen, führen Sie »dpkg --configure sysv-rc« aus."
diff -Nru sysvinit-2.88dsf/debian/postinst sysvinit-2.88dsf/debian/postinst
--- sysvinit-2.88dsf/debian/postinst 2012-04-29 18:02:44.000000000 +0100
+++ sysvinit-2.88dsf/debian/postinst 2013-01-23 22:39:44.000000000 +0000
@@ -19,7 +19,7 @@
# PID of init; may not always be 1. Use for sending signals
# and checking if init is running.
- PID="$(pidof /sbin/init || true)"
+ PID="$(pidof /sbin/init || echo 1)"
# Create /run/initctl if not present, and also create compatibility
# symlinks
diff -Nru sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mountall.sh sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mountall.sh
--- sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mountall.sh 2012-11-16 15:18:07.000000000 +0000
+++ sysvinit-2.88dsf/debian/src/initscripts/etc/init.d/mountall.sh 2013-01-23 22:40:32.000000000 +0000
@@ -55,7 +55,7 @@
mknod -m 600 "$INITCTL" p
# Reopen control channel.
- PID="$(pidof /sbin/init || true)"
+ PID="$(pidof /sbin/init || echo 1)"
[ -n "$PID" ] && kill -s USR1 "$PID"
fi
diff -Nru sysvinit-2.88dsf/debian/src/initscripts/lib/init/mount-functions.sh sysvinit-2.88dsf/debian/src/initscripts/lib/init/mount-functions.sh
--- sysvinit-2.88dsf/debian/src/initscripts/lib/init/mount-functions.sh 2012-08-31 21:14:04.000000000 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/lib/init/mount-functions.sh 2013-01-22 23:47:04.000000000 +0000
@@ -3,12 +3,13 @@
#
# Sourcer must source /lib/lsb/init-functions.sh
+# List available fstab files, including any files in /etc/fstab.d.
+# This looks ugly, but we can't use find and it's safer than globbing.
fstab_files()
{
- if ! eval 'ls /etc/fstab.d/*.fstab' >/dev/null 2>&1; then
- echo /etc/fstab
- else
- echo '/etc/fstab' '/etc/fstab.d/*'
+ echo /etc/fstab
+ if [ -d /etc/fstab.d ]; then
+ ls -1 /etc/fstab.d | grep '\.fstab$' | sed -e 's;^;/etc/fstab.d/;'
fi
}
@@ -35,17 +36,17 @@
# device node,
# 2) Swap that is on a md device or a file that may be on a md
# device,
-read_fstab () {
- fstabroot=/dev/root
- rootdev=none
- roottype=none
- rootopts=defaults
- rootmode=rw
- rootcheck=no
- swap_on_lv=no
- swap_on_file=no
+_read_fstab () {
+ echo "fstabroot=/dev/root"
+ echo "rootdev=none"
+ echo "roottype=none"
+ echo "rootopts=defaults"
+ echo "rootmode=rw"
+ echo "rootcheck=no"
+ echo "swap_on_lv=no"
+ echo "swap_on_file=no"
- for file in "$(eval ls $(fstab_files))"; do
+ fstab_files | while read file; do
if [ -f "$file" ]; then
while read DEV MTPT FSTYPE OPTS DUMP PASS JUNK; do
case "$DEV" in
@@ -53,7 +54,7 @@
continue;
;;
/dev/mapper/*)
- [ "$FSTYPE" = "swap" ] && swap_on_lv=yes
+ [ "$FSTYPE" = "swap" ] && echo swap_on_lv=yes
;;
/dev/*)
;;
@@ -64,21 +65,21 @@
fi
;;
/*)
- [ "$FSTYPE" = "swap" ] && swap_on_file=yes
+ [ "$FSTYPE" = "swap" ] && echo swap_on_file=yes
;;
*)
;;
esac
[ "$MTPT" != "/" ] && continue
- rootdev="$DEV"
- fstabroot="$DEV"
- rootopts="$OPTS"
- roottype="$FSTYPE"
- ( [ "$PASS" != 0 ] && [ "$PASS" != "" ] ) && rootcheck=yes
- ( [ "$FSTYPE" = "nfs" ] || [ "$FSTYPE" = "nfs4" ] ) && rootcheck=no
+ echo rootdev=\"$DEV\"
+ echo fstabroot=\"$DEV\"
+ echo rootopts=\"$OPTS\"
+ echo roottype=\"$FSTYPE\"
+ ( [ "$PASS" != 0 ] && [ "$PASS" != "" ] ) && echo rootcheck=yes
+ ( [ "$FSTYPE" = "nfs" ] || [ "$FSTYPE" = "nfs4" ] ) && echo rootcheck=no
case "$OPTS" in
ro|ro,*|*,ro|*,ro,*)
- rootmode=ro
+ echo rootmode=ro
;;
esac
done < "$file"
@@ -86,15 +87,29 @@
done
}
+# Read /etc/fstab, looking for:
+# 1) The root filesystem, resolving LABEL=*|UUID=* entries to the
+# device node,
+# 2) Swap that is on a md device or a file that may be on a md
+# device,
+
+read_fstab () {
+ eval "$(_read_fstab)"
+}
+
# Find a specific fstab entry
# $1=mountpoint
# $2=fstype (optional)
-# returns 0 on success, 1 on failure (not found or no fstab)
-read_fstab_entry () {
+_read_fstab_entry () {
# Not found by default.
- found=1
+ echo "MNT_FSNAME="
+ echo "MNT_DIR="
+ echo "MNT_TYPE="
+ echo "MNT_OPTS="
+ echo "MNT_FREQ="
+ echo "MNT_PASS="
- for file in "$(eval ls $(fstab_files))"; do
+ fstab_files | while read file; do
if [ -f "$file" ]; then
while read MNT_FSNAME MNT_DIR MNT_TYPE MNT_OPTS MNT_FREQ MNT_PASS MNT_JUNK; do
case "$MNT_FSNAME" in
@@ -106,12 +121,32 @@
if [ -n "$2" ]; then
[ "$MNT_TYPE" = "$2" ] || continue;
fi
- found=0
+ echo "MNT_FSNAME=$MNT_FSNAME"
+ echo "MNT_DIR=$MNT_DIR"
+ echo "MNT_TYPE=$MNT_TYPE"
+ echo "MNT_OPTS=$MNT_OPTS"
+ echo "MNT_FREQ=$MNT_FREQ"
+ echo "MNT_PASS=$MNT_PASS"
break 2
fi
+ MNT_DIR=""
done < "$file"
fi
done
+}
+
+# Find a specific fstab entry
+# $1=mountpoint
+# $2=fstype (optional)
+# returns 0 on success, 1 on failure (not found or no fstab)
+read_fstab_entry () {
+ eval "$(_read_fstab_entry "$1" "$2")"
+
+ # Not found by default.
+ found=1
+ if [ "$1" = "$MNT_DIR" ]; then
+ found=0
+ fi
return $found
}
@@ -252,10 +287,8 @@
if ! read_fstab_entry "$MTPT" "$FSTYPE"; then
CALLER_OPTS="$(echo "$CALLER_OPTS" | sed -e 's/^-o//')"
echo "Creating /etc/fstab entry for $MTPT to replace default in /etc/default/tmpfs (deprecated)" >&2
- cat << EOF
-# This mount for $MTPT replaces the default configured in /etc/default/tmpfs
-$DEVNAME $MTPT $FSTYPE $CALLER_OPTS 0 0
-EOF
+ echo "# This mount for $MTPT replaces the default configured in /etc/default/tmpfs"
+ echo "$DEVNAME $MTPT $FSTYPE $CALLER_OPTS 0 0"
fi
;;
esac
@@ -424,6 +457,14 @@
# directory. The migration logic will then take care of the
# rest. Note that it will take a second boot to fully
# migrate; it should only ever be needed on broken systems.
+ RAMSHM_ON_DEV_SHM="no"
+ if read_fstab_entry "/dev/shm"; then
+ RAMSHM_ON_DEV_SHM="yes"
+ fi
+ if read_fstab_entry "/run/shm"; then
+ RAMSHM_ON_DEV_SHM="no"
+ fi
+
if [ -L /run ]; then
if [ "$(readlink /run)" = "/var/run" ]; then
rm -f /run
@@ -431,12 +472,20 @@
fi
if bind_mount /var/run /run; then
bind_mount /var/lock /run/lock
- bind_mount /dev/shm /run/shm
+ if [ yes = "$RAMSHM_ON_DEV_SHM" ]; then
+ run_migrate /run/shm /dev/shm
+ else
+ run_migrate /dev/shm /run/shm
+ fi
fi
else
run_migrate /var/run /run
run_migrate /var/lock /run/lock
- run_migrate /dev/shm /run/shm
+ if [ yes = "$RAMSHM_ON_DEV_SHM" ]; then
+ run_migrate /run/shm /dev/shm
+ else
+ run_migrate /dev/shm /run/shm
+ fi
fi
}
@@ -512,20 +561,38 @@
{
MNTMODE="$1"
- if [ ! -d /run/shm ]
+ RAMSHM_ON_DEV_SHM="no"
+ SHMDIR="/run/shm"
+ if read_fstab_entry "/dev/shm"; then
+ if [ "$MNTMODE" = "mount_noupdate" ]; then
+ log_warning_msg "Warning: fstab entry for /dev/shm; should probably be for /run/shm unless working around a bug in the Oracle database"
+ fi
+ SHMDIR="/dev/shm"
+ RAMSHM_ON_DEV_SHM="yes"
+ fi
+ if read_fstab_entry "/run/shm"; then
+ if [ "$MNTMODE" = "mount_noupdate" ] && [ "$RAMSHM_ON_DEV_SHM" = "yes" ]; then
+ log_warning_msg "Warning: fstab entries for both /dev/shm and /run/shm found; only /run/shm will be used"
+ fi
+
+ SHMDIR="/run/shm"
+ RAMSHM_ON_DEV_SHM="no"
+ fi
+
+ if [ ! -d "$SHMDIR" ]
then
- mkdir --mode=755 /run/shm
- [ -x /sbin/restorecon ] && /sbin/restorecon /run/shm
+ mkdir --mode=755 "$SHMDIR"
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$SHMDIR"
fi
# Now check if there's an entry in /etc/fstab. If there is,
# it overrides the existing RAMSHM setting.
- if read_fstab_entry /run/shm; then
- if [ "$MNT_TYPE" = "tmpfs" ] ; then
- RAMSHM="yes"
- else
- RAMSHM="no"
- fi
+ if read_fstab_entry "$SHMDIR"; then
+ if [ "$MNT_TYPE" = "tmpfs" ] ; then
+ RAMSHM="yes"
+ else
+ RAMSHM="no"
+ fi
fi
KERNEL="$(uname -s)"
@@ -535,16 +602,20 @@
esac
if [ yes = "$RAMSHM" ]; then
- domount "$MNTMODE" tmpfs shmfs /run/shm tmpfs "-onosuid,${NODEV}noexec$SHM_OPT"
+ domount "$MNTMODE" tmpfs shmfs "$SHMDIR" tmpfs "-onosuid,${NODEV}noexec$SHM_OPT"
# Make sure we don't get cleaned
- touch /run/shm/.tmpfs
+ touch "$SHMDIR"/.tmpfs
else
- chmod "$SHM_MODE" /run/shm
+ chmod "$SHM_MODE" "$SHMDIR"
fi
# Migrate early, so /dev/shm is available from the start
if [ "$MNTMODE" = mount_noupdate ] || [ "$MNTMODE" = mount ]; then
- run_migrate /dev/shm /run/shm ../run/shm
+ if [ yes = "$RAMSHM_ON_DEV_SHM" ]; then
+ run_migrate /run/shm /dev/shm
+ else
+ run_migrate /dev/shm /run/shm
+ fi
fi
}
diff -Nru sysvinit-2.88dsf/debian/src/initscripts/man/tmpfs.5 sysvinit-2.88dsf/debian/src/initscripts/man/tmpfs.5
--- sysvinit-2.88dsf/debian/src/initscripts/man/tmpfs.5 2012-08-31 21:14:04.000000000 +0100
+++ sysvinit-2.88dsf/debian/src/initscripts/man/tmpfs.5 2012-12-17 22:35:46.000000000 +0000
@@ -76,7 +76,10 @@
Packages can not expect directories in /run/shm to exist after boot.
Note that /run/shm was previously /dev/shm, and a compatibility
symlink or bind mount will be created to allow the old path to
-continue to function.
+continue to function. If an fstab entry for /dev/shm exists instead
+of /run/shm, then /dev/shm will continue to be used; note that this is
+only needed for users of newer versions of the Oracle database, which
+contain a buggy check for /dev/shm.
.IP /tmp
Previously configured using \fBRAMTMP\fP in /etc/default/rcS. Note
unblock sysvinit/2.88dsf-38
-- System Information:
Debian Release: 7.0
APT prefers unstable
APT policy: (550, 'unstable'), (500, 'testing'), (400, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Reply to: