--- sysvinit-2.86.ds1.orig/debian/postinst +++ sysvinit-2.86.ds1/debian/postinst @@ -0,0 +1,49 @@ +#! /bin/sh +# +# sysvinit postinst +# + +set -e + +case "$1" in + configure) + oldver=$2 + ;; + abort-upgrade|abort-remove|abort-deconfigure) + exit 0 + ;; +esac + +umask 022 + +case "$(uname -s)" in + *FreeBSD) + INITCTL=/etc/.initctl + ;; + *) + INITCTL=/dev/initctl + ;; +esac + +# +# Check /dev/initctl +# +if [ "$INITCTL" ] && [ ! -p "$INITCTL" ] +then + echo "sysvinit: creating $INITCTL" + rm -f $INITCTL + mkfifo -m 600 $INITCTL +fi +rm -f /etc/ioctl.save + +if [ ! -f /etc/inittab ] +then + cp -p /usr/share/sysvinit/inittab /etc/inittab +fi + +# +# Tell init to re-exec itself. +# +init u ||: + +exit 0 --- sysvinit-2.86.ds1.orig/debian/control +++ sysvinit-2.86.ds1/debian/control @@ -0,0 +1,54 @@ +Source: sysvinit +Section: admin +Priority: required +Maintainer: Debian sysvinit maintainers +Uploaders: Miquel van Smoorenburg , Petter Reinholdtsen , Thomas Hood , Henrique de Moraes Holschuh +Standards-Version: 3.6.2.1 +Build-Depends: dpatch, libselinux1-dev (>= 1.14) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libsepol1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64] + +Package: sysvinit +Architecture: any +Pre-Depends: initscripts, sysvutils +Depends: ${shlibs:Depends} +Description: System-V-like init utilities + This package contains programs required for booting + a Debian system and doing basic process management. + . + The most important program in the package is /sbin/init. + It is the first process started on boot and continues + to run as process number 1 until the system halts. All + other processes are descended from it. + +Package: sysvutils +Essential: yes +Architecture: any +Conflicts: last +Replaces: last, sysvinit (<< 2.86.ds1-14.1ubuntu11), upstart (<= 0.2.6-1) +Pre-Depends: sysv-rc (>= 2.86.ds1-1.2) +Depends: ${shlibs:Depends} +Description: System-V-like utilities + This package contains the important System-V-like utilities. + . + Specifically, this package includes: + killall5, last, lastb, mesg, pidof + +Package: sysv-rc +Architecture: all +Conflicts: file-rc +Replaces: file-rc, sysvinit (<< 2.85-1) +Suggests: sysv-rc-conf, bum +Description: System-V-like runlevel change mechanism + This package provides support for the System-V like system + for booting, shutting down and changing runlevels, + configured through symbolic links in /etc/rc?.d/. + +Package: initscripts +Architecture: any +Depends: ${shlibs:Depends}, ${glibc:Depends}, ${mount:Depends}, e2fsprogs (>= 1.32+1.33-WIP-2003.04.14-1), debianutils (>= 2.13.1), lsb-base (>= 3.0-6), sysvutils +Conflicts: mdutils, sysv-rc (<< 2.86.ds1-1.2), sysvinit (<< 2.86.ds1-12) +Replaces: mdutils, sysvinit (<< 2.85-12), libc6, libc6.1, libc0.1, libc0.3 +Description: Scripts for initializing and shutting down the system + The scripts in this package initialize a standard Debian + GNU/Linux system at boot time and finalize it at halt or + reboot time. + --- sysvinit-2.86.ds1.orig/debian/rules +++ sysvinit-2.86.ds1/debian/rules @@ -0,0 +1,315 @@ +#! /usr/bin/make -f +# +# debian/rules file for sysvinit +# + +tmp = $(shell pwd)/debian/tmp +doc = /usr/share/doc + +SHELL = /bin/bash +LC_ALL = POSIX + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM) +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +export DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null || true) + +# Handle fact that sarge dpkg-architecture doesn't have DEB_HOST_ARCH_OS +ifeq ($(DEB_HOST_ARCH_OS),) + DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)) + ifeq ($(DEB_HOST_ARCH_OS),gnu) + DEB_HOST_ARCH_OS := hurd + endif +endif + +LIBC6 = libc6 +ifeq ($(DEB_HOST_ARCH), alpha) +LIBC6 = libc6.1 +endif +ifeq ($(DEB_HOST_ARCH), ia64) +LIBC6 = libc6.1 +endif + +define checkdir + test -f src/init.c +endef + +build: patch-stamp +# Builds the binary package. + $(checkdir) +ifeq ($(DEB_HOST_ARCH_OS),linux) + (cd src; make DISTRO=Debian WITH_SELINUX="yes") +else + (cd src; make DISTRO=Debian) +endif + make -C debian/startpar + cc -W -Wall -s -o debian/readlink debian/readlink.c + touch build + +# Make a binary package (.deb file) +binary-arch: build checkroot + # + # sysvinit package + # + -rm -rf $(tmp) + install -d -o root -g root -m 755 $(tmp) + install -d -o root -g root -m 755 $(tmp)/{DEBIAN,etc} + install -d -o root -g root -m 755 $(tmp)/usr/share/sysvinit + install -d -o root -g root -m 755 $(tmp)/usr/include + install -d -o root -g root -m 755 $(tmp)$(doc)/sysvinit + install -o root -g root -m 644 doc/Changelog \ + $(tmp)$(doc)/sysvinit/changelog + install -o root -g root -m 644 debian/changelog \ + $(tmp)$(doc)/sysvinit/changelog.Debian + install -o root -g root -m 644 debian/NEWS \ + $(tmp)$(doc)/sysvinit/NEWS.Debian + gzip -9f $(tmp)$(doc)/sysvinit/changelog* + gzip -9f $(tmp)$(doc)/sysvinit/NEWS.Debian + if test -e debian/share/inittab.$(DEB_HOST_GNU_TYPE) ; \ + then \ + install -o root -g root -m 644 \ + debian/share/inittab.$(DEB_HOST_GNU_TYPE) \ + $(tmp)/usr/share/sysvinit/inittab ; \ + elif test -e debian/share/inittab.$(DEB_HOST_GNU_SYSTEM) ; \ + then \ + install -o root -g root -m 644 \ + debian/share/inittab.$(DEB_HOST_GNU_SYSTEM) \ + $(tmp)/usr/share/sysvinit/inittab ; \ + else \ + install -o root -g root -m 644 debian/share/inittab \ + $(tmp)/usr/share/sysvinit/inittab ; \ + fi + install -o root -g root -m 755 debian/share/update-rc.d \ + $(tmp)/usr/share/sysvinit + install -d -o root -g root -m 755 $(tmp)/{bin,sbin,lib,usr} + install -d -o root -g root -m 755 $(tmp)/usr/bin + install -d -o root -g root -m 755 $(tmp)/usr/sbin + install -d -o root -g root -m 755 $(tmp)/usr/share/man + install -d -o root -g root -m 755 $(tmp)/usr/share/man/man{1,5,8} + (cd src; make ROOT=$(tmp) DISTRO=Debian install ) + make -C debian/startpar DESTDIR=$(tmp) install + strip -s -R comment -R .comment $(tmp)/sbin/startpar +ifeq ($(DEB_HOST_ARCH), hurd-i386) + # The Hurd has its own halt and reboot commands. + rm -f $(tmp)/usr/share/man/man8/halt.8 + rm -f $(tmp)/usr/share/man/man8/reboot.8 + rm -f $(tmp)/sbin/halt + rm -f $(tmp)/sbin/reboot +endif + rm -f $(tmp)/usr/share/man/man8/killall5.8 + rm -f $(tmp)/usr/share/man/man8/sulogin.8 + rm -f $(tmp)/usr/share/man/man1/last.1 + rm -f $(tmp)/usr/share/man/man1/lastb.1 + rm -f $(tmp)/usr/share/man/man1/mesg.1 + rm -f $(tmp)/usr/share/man/man8/pidof.8 + rm -f $(tmp)/usr/share/man/man1/mountpoint.1 + rm -f $(tmp)/sbin/killall5 + rm -f $(tmp)/sbin/sulogin + rm -f $(tmp)/usr/bin/last + rm -f $(tmp)/usr/bin/lastb + rm -f $(tmp)/usr/bin/mesg + rm -f $(tmp)/bin/pidof + rm -f $(tmp)/bin/mountpoint + rmdir $(tmp)/usr/share/man/man1 + rmdir $(tmp)/usr/sbin + rmdir $(tmp)/usr/bin + rmdir $(tmp)/bin + gzip -9f $(tmp)/usr/share/man/man*/*.[0-9] + install -o root -g root -m 644 debian/copyright \ + $(tmp)$(doc)/sysvinit/copyright + cat COPYRIGHT >> $(tmp)$(doc)/sysvinit/copyright + install -o root -g root -m 755 debian/postinst $(tmp)/DEBIAN/postinst + dpkg-shlibdeps src/init debian/startpar/startpar + dpkg-gencontrol -psysvinit -P$(tmp) -isp + dpkg --build $(tmp) .. + rm -rf $(tmp) + # + # sysvutils package + # + -rm -rf $(tmp) + install -d -o root -g root -m 755 $(tmp) + install -d -o root -g root -m 755 $(tmp)/DEBIAN + install -d -o root -g root -m 755 $(tmp)$(doc)/sysvutils + install -o root -g root -m 644 doc/Changelog \ + $(tmp)$(doc)/sysvutils/changelog + install -o root -g root -m 644 debian/changelog \ + $(tmp)$(doc)/sysvutils/changelog.Debian + gzip -9f $(tmp)$(doc)/sysvutils/changelog* + install -d -o root -g root -m 755 $(tmp)/{bin,sbin,lib,usr} + install -d -o root -g root -m 755 $(tmp)/usr/bin + install -d -o root -g root -m 755 $(tmp)/usr/share/man + install -d -o root -g root -m 755 $(tmp)/usr/share/man/man{1,8} + install -o root -g root -m 755 src/killall5 $(tmp)/sbin + install -o root -g root -m 755 src/sulogin $(tmp)/sbin + install -o root -g root -m 755 src/last $(tmp)/usr/bin + install -o root -g root -m 755 src/mesg $(tmp)/usr/bin + strip -s -R .comment $(tmp)/sbin/killall5 + strip -s -R .comment $(tmp)/sbin/sulogin + strip -s -R .comment $(tmp)/usr/bin/last + strip -s -R .comment $(tmp)/usr/bin/mesg + ln -sf ../sbin/killall5 $(tmp)/bin/pidof + ln -sf last $(tmp)/usr/bin/lastb + install -o root -g root -m 644 man/killall5.8 $(tmp)/usr/share/man/man8 + install -o root -g root -m 644 man/sulogin.8 $(tmp)/usr/share/man/man8 + install -o root -g root -m 644 man/last.1 $(tmp)/usr/share/man/man1 + install -o root -g root -m 644 man/lastb.1 $(tmp)/usr/share/man/man1 + install -o root -g root -m 644 man/mesg.1 $(tmp)/usr/share/man/man1 + install -o root -g root -m 644 man/pidof.8 $(tmp)/usr/share/man/man8 + gzip -9f $(tmp)/usr/share/man/man*/*.[0-9] + install -o root -g root -m 644 debian/copyright \ + $(tmp)$(doc)/sysvutils/copyright + cat COPYRIGHT >> $(tmp)$(doc)/sysvutils/copyright + dpkg-shlibdeps src/init + dpkg-gencontrol -psysvutils -P$(tmp) -isp + dpkg --build $(tmp) .. + rm -rf $(tmp) + # + # initscripts package + # + -rm -rf $(tmp) + install -d -o root -g root -m 755 $(tmp) + install -d -o root -g root -m 755 $(tmp)/{DEBIAN,sbin,lib,etc} +ifeq ($(DEB_HOST_ARCH_OS),linux) + install -d -o root -g root -m 755 $(tmp)/sys +endif + install -d -o root -g root -m 755 $(tmp)/lib/init + install -d -o root -g root -m 755 $(tmp)/usr/share/initscripts + install -d -o root -g root -m 755 $(tmp)/var/lib/initscripts + install -d -o root -g root -m 755 $(tmp)/var/log/fsck + install -d -o root -g root -m 755 $(tmp)$(doc)/initscripts + install -o root -g root -m 644 debian/initscripts/doc/* $(tmp)$(doc)/initscripts + sed -ne '/sysvinit (2.84-3)/q' -e p < debian/changelog \ + > $(tmp)$(doc)/initscripts/changelog.Debian + chmod 644 $(tmp)$(doc)/initscripts/changelog.Debian + gzip -9f $(tmp)$(doc)/initscripts/* + cp -afv debian/initscripts/share/* $(tmp)/usr/share/initscripts + cp -afv debian/initscripts/etc/* $(tmp)/etc + cp -afv debian/initscripts/lib/* $(tmp)/lib + chmod 755 $(tmp)/etc/init.d/[a-z]* + chmod 755 $(tmp)/etc/network/if-up.d/[a-z]* + chmod 644 $(tmp)/lib/init/*.sh + chmod -R g-w $(tmp) + chown -R root:root $(tmp) + install -d -o root -g root -m 755 $(tmp)/bin + install -d -o root -g root -m 755 $(tmp)/etc/default + install -d -o root -g root -m 755 $(tmp)/usr/share/man/man1 + install -d -o root -g root -m 755 $(tmp)/usr/share/man/man5 + install -d -o root -g root -m 755 $(tmp)/usr/share/man/man8 + install -d -o root -g root -m 755 $(tmp)/var/lib/urandom + install -o root -g root -m 755 debian/initscripts/sbin/fsck.nfs \ + $(tmp)/sbin/fsck.nfs + install -o root -g root -m 644 debian/initscripts/man/fsck.nfs.8 \ + $(tmp)/usr/share/man/man8/fsck.nfs.8 + install -o root -g root -m 644 debian/initscripts/rcS.5 \ + $(tmp)/usr/share/man/man5 + install -o root -g root -m 755 src/mountpoint $(tmp)/bin + strip -s -R .comment $(tmp)/bin/mountpoint + install -o root -g root -m 644 man/mountpoint.1 $(tmp)/usr/share/man/man1 + install -o root -g root -m 755 debian/readlink $(tmp)/lib/init + strip -s -R .comment $(tmp)/lib/init/readlink + gzip -9f $(tmp)/usr/share/man/man*/*.[0-9] + install -d -o root -g root -m 755 $(tmp)/usr/share/lintian/overrides + install -o root -g root -m 644 \ + debian/initscripts/lintian.overrides \ + $(tmp)/usr/share/lintian/overrides/initscripts + install -d -o root -g root -m 755 $(tmp)/usr/share/linda/overrides + install -o root -g root -m 644 \ + debian/initscripts/linda.overrides \ + $(tmp)/usr/share/linda/overrides/initscripts + install -o root -g root -m 644 debian/initscripts/copyright \ + $(tmp)$(doc)/initscripts/copyright + install -o root -g root -m 755 debian/initscripts/preinst $(tmp)/DEBIAN + install -o root -g root -m 755 debian/initscripts/postinst $(tmp)/DEBIAN + install -o root -g root -m 755 debian/initscripts/postrm $(tmp)/DEBIAN + install -o root -g root -m 644 debian/initscripts/conffiles \ + $(tmp)/DEBIAN/conffiles + dpkg-shlibdeps debian/readlink + sh debian/deps-mount >> debian/substvars + sh debian/deps-glibc >> debian/substvars + dpkg-gencontrol -pinitscripts -P$(tmp) -isp + dpkg --build $(tmp) .. + rm -rf $(tmp) + + +# Architecture independant files. +binary-indep: build checkroot + # + # sysv-rc package + # + -rm -rf $(tmp) + install -d -o root -g root -m 755 $(tmp)/{DEBIAN,etc} + install -d -o root -g root -m 755 $(tmp)/usr/share + install -d -o root -g root -m 755 $(tmp)$(doc)/sysv-rc + install -o root -g root -m 644 debian/sysv-rc/doc/* $(tmp)$(doc)/sysv-rc + sed -ne '/sysvinit (2.84-3)/q' -e p < debian/changelog \ + > $(tmp)$(doc)/sysv-rc/changelog.Debian + chmod 644 $(tmp)$(doc)/sysv-rc/changelog.Debian + gzip -9f $(tmp)$(doc)/sysv-rc/* + install -d -o root -g root -m 755 $(tmp)/etc/rc{2,3,4,5}.d + cp -af debian/sysv-rc/etc/* $(tmp)/etc + for N in 2 3 4 5 ; do \ + install -o root -g root -m 644 debian/sysv-rc/rc2-5.d-README \ + $(tmp)/etc/rc$${N}.d/README ; \ + done + chmod 755 $(tmp)/etc/init.d/[a-z]* + chmod 644 $(tmp)/etc/init.d/README + chmod -R go=u-w $(tmp)/etc + chown -R root:root $(tmp)/etc + install -d -o root -g root -m 755 $(tmp)/usr/sbin + install -d -o root -g root -m 755 $(tmp)/usr/share/man/man5 + install -d -o root -g root -m 755 $(tmp)/usr/share/man/man8 + install -d -o root -g root -m 755 $(tmp)/usr/share/man/ja/man8 + install -d -o root -g root -m 755 $(tmp)/usr/share/man/fr/man8 + install -d -o root -g root -m 755 $(tmp)/usr/share/man/es/man8 + install -o root -g root -m 644 debian/sysv-rc/man8/*.8 \ + $(tmp)/usr/share/man/man8 + install -o root -g root -m 644 debian/sysv-rc/man8/ja/*.8 \ + $(tmp)/usr/share/man/ja/man8 + install -o root -g root -m 644 debian/sysv-rc/man8/fr/*.8 \ + $(tmp)/usr/share/man/fr/man8 + install -o root -g root -m 644 debian/sysv-rc/man8/es/*.8 \ + $(tmp)/usr/share/man/es/man8 + install -o root -g root -m 755 debian/sysv-rc/sbin/invoke-rc.d $(tmp)/usr/sbin + install -o root -g root -m 755 debian/sysv-rc/sbin/update-rc.d $(tmp)/usr/sbin + gzip -9f $(tmp)/usr/share/man/man*/*.[0-9] \ + $(tmp)/usr/share/man/??/man*/*.[0-9] + install -d -o root -g root -m 755 $(tmp)/usr/share/lintian/overrides + install -o root -g root -m 644 \ + debian/sysv-rc/lintian.overrides \ + $(tmp)/usr/share/lintian/overrides/sysv-rc + install -d -o root -g root -m 755 $(tmp)/usr/share/linda/overrides + install -o root -g root -m 644 \ + debian/sysv-rc/linda.overrides \ + $(tmp)/usr/share/linda/overrides/sysv-rc + install -o root -g root -m 644 debian/sysv-rc/copyright \ + $(tmp)$(doc)/sysv-rc/copyright + install -o root -g root -m 755 debian/sysv-rc/postinst $(tmp)/DEBIAN/postinst + install -o root -g root -m 755 debian/sysv-rc/postrm $(tmp)/DEBIAN/postrm + dpkg-gencontrol -psysv-rc -P$(tmp) -isp + dpkg --build $(tmp) .. + rm -rf $(tmp) + +clean: checkroot unpatch + (cd src; make clobber ) + -make -C debian/startpar clean + rm -f build debian/files debian/substvars debian/readlink + rm -rf $(tmp) + find . -name '*.bak' -o -name '*~' | xargs -r rm -f -- + +binary: binary-arch binary-indep + +checkroot: + $(checkdir) + test root = "`whoami`" + +buildfromsvn: + version=`dpkg-parsechangelog | grep Version: | awk '{print $$2}'`; \ + rm -rf ../sysvinit-$$version; \ + svn export . ../sysvinit-$$version; \ + cp debian/changelog ../sysvinit-$$version/debian/changelog; \ + chmod -R a-s ../sysvinit-$$version; \ + (cd ../sysvinit-$$version && debuild $(DEBUILDFLAGS)) + +.PHONY: binary binary-arch binary-indep clean checkroot + +include /usr/share/dpatch/dpatch.make --- sysvinit-2.86.ds1.orig/debian/sysvinit-watch +++ sysvinit-2.86.ds1/debian/sysvinit-watch @@ -0,0 +1,2 @@ +version=2 +ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-([\d\.\d]+)\.tar\.gz --- sysvinit-2.86.ds1.orig/debian/changelog +++ sysvinit-2.86.ds1/debian/changelog @@ -0,0 +1,2245 @@ +sysvinit (2.86.ds1-14.1ubuntu16) edgy; urgency=low + + * Drop mention of file-rc, it doesn't work in Ubuntu. + + -- Scott James Remnant Fri, 6 Oct 2006 11:39:28 +0100 + +sysvinit (2.86.ds1-14.1ubuntu15) edgy; urgency=low + + * Clarify sulogin(8) man page to describe default behaviour in Ubuntu + with the locked root account. Ubuntu: #58404. + * Also consider ltsp-client and end-point for the usplash + progress bar. Ubuntu: #62036. + + -- Scott James Remnant Thu, 5 Oct 2006 10:24:49 +0100 + +sysvinit (2.86.ds1-14.1ubuntu14) edgy; urgency=low + + * mountdevsubfs: add some magic to make /proc/bus/usb "work". We + actually mount it elsewhere with restrictive permissions, and just + symlink the devices file into /dev/bus/usb then bind-mount *that* to + /proc/bus/usb. Applications won't know the difference, he he. + + -- Scott James Remnant Mon, 2 Oct 2006 17:32:59 +0100 + +sysvinit (2.86.ds1-14.1ubuntu13) edgy; urgency=low + + * Don't reset step to 0 between running Kill and Start scripts + (this is why the progress bar jumps during splash down) + + -- Scott James Remnant Thu, 21 Sep 2006 05:36:08 +0100 + +sysvinit (2.86.ds1-14.1ubuntu12) edgy; urgency=low + + * Set QUIET=yes if "quiet" is found on the kernel command-line. + * Always output fsck progress to the console. Ubuntu: #58609. + + -- Scott James Remnant Thu, 21 Sep 2006 03:05:51 +0100 + +sysvinit (2.86.ds1-14.1ubuntu11) edgy; urgency=low + + * Move sulogin from sysvinit to sysvutils. Ubuntu: #60965. + + -- Scott James Remnant Wed, 20 Sep 2006 05:35:35 +0100 + +sysvinit (2.86.ds1-14.1ubuntu10) edgy; urgency=low + + * Correct sysvutils Replaces sysvinit from << to <=. Ubuntu: #60275. + + -- Scott James Remnant Wed, 13 Sep 2006 20:51:41 +0100 + +sysvinit (2.86.ds1-14.1ubuntu9) edgy; urgency=low + + * Call usplash_down rather than invoking usplash directly. This sets the + appropriate video mode and other nice things + + -- Matt Zimmerman Fri, 8 Sep 2006 14:24:30 -0700 + +sysvinit (2.86.ds1-14.1ubuntu8) edgy; urgency=low + + * Make sysv-rc a dependency of the Essential sysvutils package. + + -- Scott James Remnant Thu, 7 Sep 2006 02:44:49 +0100 + +sysvinit (2.86.ds1-14.1ubuntu7) edgy; urgency=low + + * And now we make sysvinit no longer Essential, so if anybody feels like + replacing it with something else, dpkg won't complain. + + -- Scott James Remnant Thu, 31 Aug 2006 20:57:22 +0100 + +sysvinit (2.86.ds1-14.1ubuntu6) edgy; urgency=low + + * Oops, add missing replaces for sysvutils on sysvinit. + + -- Scott James Remnant Thu, 31 Aug 2006 17:06:17 +0100 + +sysvinit (2.86.ds1-14.1ubuntu5) edgy; urgency=low + + * Split killall5, last, lastb, mesg and pidof out of the sysvinit + package into a new sysvutils package that sysvinit and initscripts + depend on. This allows us to replace init without having to reimplement + these utilities. + + -- Scott James Remnant Thu, 31 Aug 2006 17:01:22 +0100 + +sysvinit (2.86.ds1-14.1ubuntu4) edgy; urgency=low + + * Mount /proc, /sys, /var/run and /var/lock with more restrictive + options. Ubuntu: #54530 + + -- Scott James Remnant Wed, 23 Aug 2006 11:28:23 +0200 + +sysvinit (2.86.ds1-14.1ubuntu3) edgy; urgency=low + + * Suppress warning about files being hidden under a mount point unless + VERBOSE is enabled + + -- Matt Zimmerman Fri, 4 Aug 2006 20:16:20 -0700 + +sysvinit (2.86.ds1-14.1ubuntu2) edgy; urgency=low + + * update-rc.d: add new "multiuser" keyword that performs the same job + as the existing "defaults" keyword, except that it does not place + a stop link in either rc0 or rc6. + + -- Scott James Remnant Thu, 20 Jul 2006 21:15:30 +0100 + +sysvinit (2.86.ds1-14.1ubuntu1) edgy; urgency=low + + * Merge from debian unstable, remaining changes: + - /var/run and /var/lock mounted as tmpfs early in the boot process, + - not cleaned at boot time, + - not unmounted at shutdown or reboot, + - mounts of /var are guarded to protect these mountpoints. + - /proc/bus/usb not mounted, + - /dev/pts always mounted and /dev/ptmx created only by udev, + - mountnfs called from /etc/network/if-up.d instead of init, + - mtab handled completely from mtab.sh, not speculatively, + - /dev/.udev.log saved as /var/log/udev if it exists, + - message change to sendsigs, + - sendsigs restores usplash, + - VERBOSE=no byu default, + - mountvirtfs dropped entirely, + - /etc/rc.local run at end of boot process, + - different boot order, + - usplash progress charted during shutdown and during initramfs, + - runlevel documentation patch, + - our own sulogin and splash patches. + + -- Scott James Remnant Mon, 3 Jul 2006 22:20:09 +0100 + +sysvinit (2.86.ds1-14.1) unstable; urgency=low + + * Non-maintainer upload. + * mountnfs.sh: If needed, call nfs-common's init.d script to start + rpc.gssd or rpc.idmapd as needed. This is needed for Kerberized NFS + mounts and NFSv4 mounts. (Closes: #359176) + + -- Steinar H. Gunderson Sat, 6 May 2006 21:12:39 +0200 + +sysvinit (2.86.ds1-14) unstable; urgency=low + + [ Thomas Hood ] + * umountfs: Unmount in order of decreasing mount point length + without making use of the sort program (Closes: #356226) + Thanks to Jiri Polach + * Don't Build-Depend on selinux stuff on kfreebsd-amd64 + (Closes: #357245) + * Make initscripts Conflict with sysvinit (<< 2.86.ds1-12) because + bootlogd initscript uses an option that was introduced in + 2.86.ds1-12 (Closes: #357667) + * bootlogd: Mention -p and -c options in usage message + (Closes: #357667 too) + + -- Thomas Hood Thu, 16 Mar 2006 19:45:04 +0100 + +sysvinit (2.86.ds1-13) unstable; urgency=low + + [ Thomas Hood ] + * umountfs: Unmount even if sort not available (Addresses #356226) + * last: Fix strncmp bug (Closes: #353585) + * umountroot: Tweak handling of error messages from mount + (Closes: #352398) + * /etc/init.d/skeleton: Source init-functions (Closes: #353212) + * initscripts.postrm: Don't remove /etc/init.d/mountdevsubfs + * mount{all,nfs}.sh: Don't set TMPTIME cuz it's not used here + * pidof.8: Don't imply that pidof is in /sbin (Closes: #352741) + * sysv-rc: /etc/init.d/README: Refer user to /usr/share/doc/sysv-rc/ + (Closes: #353083) + * Add NEWS.Debian with entry for 2.86.ds1-10 which reports the + replacement of the bootclean.sh function library by the + bootclean initscript. (Closes: #355746) + + [ Petter Reinholdtsen ] + * Silence init.d/hostname.sh when VERBOSE=no. + * /etc/init.d/skeleton: Show how to use the VERBOSE variable. + + -- Thomas Hood Mon, 13 Feb 2006 08:42:44 +0100 + +sysvinit (2.86.ds1-12) unstable; urgency=low + + [ Thomas Hood ] + * Aim for testing: Closes: #341075 + * Fix dependency on mount for GNU/kFreeBSD (Closes: #349984) + This involved updating deps-mount and deps-glibc (Closes: #335297) + * bootlogd: 51_bootlogd_syncalot: Don't sync after each line unless + the (new) -s option is given + (Closes: #205724) + * bootlogd: 52_bootlogd_createlogfile.dpatch: Don't write to logfile + if it doesn't exist unless the (new) -c option is given + (Closes: #341167) + * bootlogd: 53_bootlogd_ttyB.dpatch: Also try ttyB0 + (Closes: #348506) + * last: 25_last_sanify: In "last -x" output: + + On "reboot" line print endpoint of uptime too + + On "shutdown" line print downtime rather that time between downs + (Closes: #58119) + * init: 41_selinux_console.dpatch: print to same console as others do + (Closes: #349149) + * bootclean: Don't fail to clean all directories in /tmp + (Closes: #350218) + * mountall.sh: Suppress error message about /proc already being mounted + (Closes: #349275) + * checkroot.sh: Don't try to enable swap if a swap device is + /dev/mapper/* or a swapfile (Closes: #346329, #348534) + * checkroot.sh: Remove some code specific to pre-2.4-Linux + * umountfs + - Don't try to unmount tmpfs on /dev (Closes: #350998) + - Improve comment explaining use of sort (Closes: #351497) + * several scripts: messages: Tweak; better condition them on $VERBOSE + * initscripts postinst: Don't run mount{kern,devsub}fs.sh + * initscripts postinst: Actually remove some things on purge + * rcS(5): Improve; mention that if UTC=no then admin must ensure + that zoneinfo is available + * shutdown(8): Fix typo (Closes: #350830) + * Add README.Debian for sysv-rc + * debian/rules: + + Handle older dpkg-architecture + + Tweak Build-Depends on libselinux1-dev (Closes: #340285, #351906) + + [ Robert Millan / TH ] + * inittab on GNU/kFreeBSD: (Closes: #351615) + - Pass "cons25" as parameter to getty (leaving it unspecified + required hacks in the getty side). + - "translate" all device names into kfreebsd ones, including those + in comments. + + [ A Costa / TH ] + * man pages: 10_doc_manuals.dpatch: Fix a shipload o' typos + (Closes: #349768, #349769, #349770, #349771, #349772, #349773) + + [ Ruben Porras / TH ] + * Fix typos in Spanish update-rc.d(8) (Closes: #349805) + + [ Henrique de Moraes Holschuh ] + * [S390] inittab: rename inittab.s390-linux to inittab.s390-linux-gnu + (Closes: #351871) + + -- Henrique de Moraes Holschuh Thu, 9 Feb 2006 09:27:51 -0200 + +sysvinit (2.86.ds1-11) unstable; urgency=low + + [ Thomas Hood ] + * rcS(5): Improve + * sulogin(8): Improve; mention -t option (Closes: #186880) + * bootlogd(8): Improve; mention need for PTY support + * initscripts postinst: Update to reflect script name changes + * initscripts: Harmonize PATH settings + * checkroot.sh: Don't check for need to start /sbin/update. + We don't support pre-2.4 kernels any more. + * checkroot.sh, mountall.sh: Run swapon with -v if VERBOSE!=no + * Remove obsolete lintian overrides + * Previous release also + closes: #258290 "bootlogd: Bad file descriptor" + closes: #327865 "bootlogd stopped working" + closes: #328764 "bootlogd fails to start" + + [ Petter Reinholdtsen ] + * Time to upload all these changes into unstable (Closes: #341075) + * Revert default VERBOSE value to "yes" to reduce the amount of + user visible changes in this upload. + + -- Petter Reinholdtsen Sun, 22 Jan 2006 22:17:38 +0100 + +sysvinit (2.86.ds1-10) experimental; urgency=low + + [ Thomas Hood ] + * bootclean: Adapt from old bootclean.sh; handle return status more + carefully; print diagnostic messages on failures; eliminate use of + subshells; add comments; improve deletion code + * bootclean: Always rm /tmp/.X*-lock + * mountall.sh: Eliminate unnecessary check for pre-2.4 Linux kernel + * mountnfs.sh, mountall.sh: Choose different names for intnl. functions + * mountnfs.sh: Only sleep 1 second after starting portmap; note that + the code to start portmap will disappear someday + * various scripts: Make more messages depend on VERBOSE being != "no" + * various scripts: Handle return status more carefully + * various scripts: Eliminate unnecessary uses of subshell + * mountvirtfs -> mountkernfs.sh; mountdevsubfs -> mountdevsubfs.sh; + mountvirtfs now calls the above two (for backward compatibility); + mtab.sh now runs mountkernfs.sh and mountdevsubfs.sh to update + the mtab file after mountall.sh. + * /etc/init.d/rc: Restore PATH after sourcing an initscript + * debian/rules: + + Use ':', not the deprecated '.' between owner and group names + in chown commands + + Use '-o root' with install + * /etc/init.d/README: Note that /etc/init.d/*.sh must have '#!/bin/sh' + and must follow policy 10.4. + * Override lintian and linda warnings + + [ Ubuntu backports by T.H. ] + * During shutdown and reboot take the progress bar from 100 to 0 + * Reduce diff with 2.86.ds1-6ubuntu1 + + Thanks to Mark Hatle and Marco d'Itri for help with this release. + + -- Petter Reinholdtsen Sun, 15 Jan 2006 13:38:42 +0100 + +sysvinit (2.86.ds1-9) experimental; urgency=low + + [ Thomas Hood ] + * Split mountdevsubfs out of mountvirtfs and run it at S04 and S37. + [Note added in 2.86.ds1-10: these scripts were renamed] + This should not behave any differently, but the split will allow + packages that futz with /dev to do this at S03. + * umountfs: Only run umount if there is something to unmount + (Closes: #345272) + * urandom: Set PATH so that find can be found (Closes: #345273) + * init: 64_init_set_PATH.dpatch: Set PATH if it's unset on re-exec + (Closes: #345370) + * init: 65_init_u_in_06.dpatch: Allow 'telinit u' in runlevels 0, 6 + (Closes: #345719) People running Debian from unusual media (such + as filesystems embedded in NTFS files) are wanting to unmount + /sbin at the last moment and need to re-exec init to do so. + * umountroot: Remount ro with -f on GNU/kFreeBSD (Closes: #344547) + * checkroot.sh, checkfs.sh: Pause for five seconds if sulogin fails + so that the user can see the error message (Addresses #337444) + * Include /var/log/fsck/ in initscripts package (Closes: #346139) + * Replace /lib/init/functions.sh with /lib/init/mount-functions.sh + for use by mountvirtfs and mountdevsubfs + * various initscripts: Clean up code that reads fstab + * various scripts: Redirect which program's stderr to /dev/null + since the GNU version prints an error message when the command is + not found (Closes: #345321) + * /etc/default/rcS: Make VERBOSE and DELAYLOGIN default to "no" + * /etc/default/rcS: Remove descriptions of variables; leave behind + a reference to rcS(5). This eliminates the problem of comments + becoming outdated without our being able to update them. + * Remove obsolete docs + * Make initscripts Depend on mount >= 2.11x-1 (Closes: #345968) + * Remove obsolete dependencies on bsdutils, coreutils, dpkg, kbd and + util-linux: the versions in question are older than oldstable, so + any newly installed system and any system that has upgraded to + sarge (or even woody) satisfies the constraints. + * Remove obsolete dependency on the last package: last was forced off + systems when they upgraded to buzz + * Add Replaces to Conflicts: mdutils which no longer exists even in + oldstable + * initscripts postinst: Remove obsolete GMT-to-UTC code: this + conversion was performed when systems were upgraded to potato + * sysvinit: Depend on libc6 rather than Pre-Depending on it; we don't + do anything special in the preinsts any more + * Correct documentation of init's -e and -t options + * Tweak descriptions + * Add READMEs for remaining runlevel dirs (Closes: #242957) + * Previous release also + closes: #227540 "skeleton: Don't include /usr/local/* in PATH" + closes: #346415 "mountnfs.sh doesn't work with the "bg" mount option" + + [ Petter Reinholdtsen ] + * sysv-rc: Fix some typos in the startpar handling. (Closes: #345269) + * Add code to detect and report bad 'exit' calls in init.d scripts, + if they kill /etc/init.d/rc. + * Make sure sourcing work with dash /bin/sh, by using 'set $action' + to pass arguments to the script. (Closes: #345267) + + Thanks to Mark Hatle for help with this release. + + -- Petter Reinholdtsen Sun, 8 Jan 2006 18:08:51 +0100 + +sysvinit (2.86.ds1-8) experimental; urgency=low + + [ Thomas Hood ] + * Omit /run until we are sure it's needed (Closes: #344001) + * Previous release also + closes: #338736 "mountvirtfs: Succeeds in various cases it should fail" + closes: #342160 "checkroot.sh ignores fsck result" + closes: #342744 "checkroot.sh sources mountvirtfs, yet supplies arguments" + * Use /proc/mounts instead of /etc/mtab when unmounting (Closes: #338801) + * Check for files under mountpoints more thoroughly + * initscripts.postinst: + + Don't fail to install on file-rc systems (Closes: #343993) + + Don't fail to install in chroots (Closes: #344089) + * No longer keep the dynamic nologin flag file on the root filesystem; + instead, keep it at /var/lib/initscripts/nologin. Note to admins: + initscripts's postinst symlinks /etc/nologin to the latter location. + To switch login delaying on or off permanently, set DELAYLOGIN=no in + /etc/default/rcS and either create or delete (respectively) + /var/lib/initscripts/nologin. + * mountvirtfs: Mount /dev/shm earlier; move long comment to README.Debian + * Add 45_pidof_symlink.dpatch: Make pidof an absolute symlink + (Closes: #343862) + * debian/rules, 30_strip.dpatch: Strip .comment section from executables + (Closes: #343863) + * In umountfs, run umount with -f (Closes: #344547) + + [ Petter Reinholdtsen ] + * Enable the startpar option as it should work now that .sh scripts + are serialized. The clock should no longer jump while startpar + is used. + + -- Petter Reinholdtsen Tue, 27 Dec 2005 14:18:19 +0100 + +sysvinit (2.86.ds1-7) experimental; urgency=low + + [ Petter Reinholdtsen ] + * Add commented-out code to /etc/init.d/rc for sourcing + *.sh scripts for runlevel 'S'. This is preparation for fixing + #339955. Actually fixing it has to wait until other packages + remove "exit" from their .sh scripts. + * Implement progress bar support for splash screen. Enabled when + usplash_write is in PATH. Patch from Scott James Remnant and Ubuntu. + + [ Thomas Hood ] + * *.sh: Make sure that these do their thing when they aren't given any + command line arguments (as is the case when they are sourced) + * initscripts: Improve use of log_* functions + (Closes: #55143, #116366, #323749) + * bootclean.sh: Do not delete symlinks-to-directories from /var/run/ + (Closes: #272066) + * checkroot.sh: Fix double printing of 'Done checking root file system'; + mountall.sh: Fix chopped-up printing of mount information + (Closes: #339979, #331397, #341097 and presumably closes: #332309) + * checkroot.sh, checkfs.sh: Save fsck logs (Closes: #189356) + Thanks to Theodore Y. Ts'o. + * checkroot.sh, mountvirtfs: Eliminate use of dir_writable in order to + try to please selinux (Closes: #333836) + * checkroot.sh: Only run findfs for mount on / (Closes: #275680) + Thanks to Cameron Hutchison for the patch. + * mountall.sh, mountnfs.sh: Split call to bootclean out into separate + script called at the next sequence number (Closes: #286479) + * bootmisc.sh: Shorten motd header (Closes: #340017) + * bootmisc.sh: Store dynamic motd in /var/run/ and make /etc/motd a + symbolic link. The EDITMOTD variable no longer has any effect; to + disable updating of the motd just point the /etc/motd symlink to a + static file such as /etc/motd.static. + * bootmisc.sh: Rotate dmesg log with savelog (Closes: #237074) + and chgrp adm. + * umountroot: Change mount command in order to exclude bind mounts of + the root directory (Closes: #339023) + * Replace /etc/rc1.d/20single by /etc/rc1.d/S30killprocs and + /etc/rc1.d/S99single so that packages can insert scripts to do + things between the "killall5" in the former and the "exec init -t1 S" + in the latter. This may help to address #145280. + * umountfs: Unmount tmpfs before swapoff and other fs's afterwards + (Closes: #328582, hopefully without reopening #84782) + * Make stop-bootlogd a distinct script rather than a symlink to bootlogd. + Give it its own LSB header. + * Add stop-bootlogd-single initscript to stop bootlogd in "single" mode + (Closes: #213028, #220025) + * checkfs.sh: Implement FSCKTYPES (Closes: #89481) Set, e.g., + FSCKTYPES="ext2,msdos" to fsck only file system types ext2 and msdos + See fsck(8) for syntax. FSCKTYPES="none" disables fsck of file + systems (other than the root filesystem) altogether. + * all initscripts: Set variables using common script + * all initscripts: Fix usage messages + * all initscripts: Allow VERBOSE to be set via the INIT_VERBOSE=yes + kernel argument (Closes: #286082) Experimental. The name of the + kernel argument may change in the future if we decide to implement + this more generally. + * Improve skeleton initscript + * all scripts: Clean up; standardize indentation + * all scripts: Use the "which" program to test for executability + * initscripts: Experimentally include /run; include /sys in Linux + builds + * mountvirtfs: Mount a tmpfs on /run + * mountvirtfs: Warn if mount point has stuff under it (Closes: #95390) + * initscripts postinst: Mount virtual filesystems + * initscripts preinst: Remove ancient /etc/init.d/boot conversion code + (Closes: #343596) + * default config files: Clean up comments + * Make initscripts Depend on debianutils >= 2.13.1 in order to prevent + #295850. Note that debianutils also has to be >= 2.12.0 so that the + "which" program is available in /bin. + * Remove currently unneeded sysvinit Dependency on coreutils + (Closes: #316423) + * pidof: If the program is specified with a path, don't match processes + of programs run from different paths (Closes: #160329) + * init: 40_selinux.dpatch: Remove superfluous printf argument + * init: Add 63_init_longer_procname.dpatch (Closes: #336172) + * init.8: Mention that entering runlevel 1 kills all processes + (Closes: #238861) + * update-rc.d.8: Mention that update-rc.d will not create multiple start + or multiple stop symlinks for a service in a single runlevel directory. + (Closes: #330155) + * Update FSF address + + -- Petter Reinholdtsen Sat, 17 Dec 2005 21:26:03 +0100 + +sysvinit (2.86.ds1-6ubuntu33) edgy; urgency=low + + * Disable mounting of /proc/bus/usb again now we're in a development + release again. + + -- Scott James Remnant Tue, 27 Jun 2006 13:10:02 +0100 + +sysvinit (2.86.ds1-6ubuntu32) dapper; urgency=low + + * Make sure we only call usplash in sendsigs if it's installed. + + -- Adam Conrad Tue, 23 May 2006 19:53:51 +1000 + +sysvinit (2.86.ds1-6ubuntu31) dapper; urgency=low + + * Make sure we print the companion log_action_end_msg for the now + non-verbose filesystem checking one. Ubuntu: #44899. + * Correct mountall to not print messages when not verbose. Ubuntu: #43172. + * Correct runlevel manpage to be less misleading. Ubuntu: #20365. + * Correct usplash patch to not remove "INIT" from before its own version + number. Ubuntu: #41370 + + -- Scott James Remnant Thu, 18 May 2006 02:13:44 +0100 + +sysvinit (2.86.ds1-6ubuntu30) dapper; urgency=low + + * Only wait on remote filesystems. + + -- Scott James Remnant Tue, 16 May 2006 00:51:17 +0100 + +sysvinit (2.86.ds1-6ubuntu29) dapper; urgency=low + + * Always send a progress message from checkfs.sh, not only in verbose mode. + Otherwise, it's very confusing when a long fsck actually does run + * Make the count for the progress bar more accurate (off by one) + + -- Matt Zimmerman Thu, 11 May 2006 17:29:51 -0700 + +sysvinit (2.86.ds1-6ubuntu28) dapper; urgency=low + + * Upload the right version of the waitnfs.sh script that actually ignores + comments and noauto devices, etc. Thanks to Stephen Ryan for spotting + this. + + -- Scott James Remnant Thu, 11 May 2006 01:18:04 +0100 + +sysvinit (2.86.ds1-6ubuntu27) dapper; urgency=low + + * Move the mountnfs.sh init script to a network if-up.d script, and + clean up a little now it's not being run in the main boot sequence. + * Place a simple waitnfs.sh init script in its place that waits for + /usr to be mounted if necessary. + + -- Scott James Remnant Tue, 9 May 2006 16:15:34 +0100 + +sysvinit (2.86.ds1-6ubuntu26) dapper; urgency=low + + * Restart usplash after sending it the KILL signal. + * Make the TERM/KILL messages a little less jargony. + * Make the unmounting remove/virtual filesystems message shorter so it + fits in usplash. + * Don't unmount /var/run or /var/lock, fixes a slight ifstate bug. + + -- Scott James Remnant Wed, 19 Apr 2006 10:27:19 +0100 + +sysvinit (2.86.ds1-6ubuntu25) dapper; urgency=low + + * Move /var/run and /var/lock to a path under /dev/shm (a tmpfs) so it + works on a readonly-root, or shared NFS-root. + + -- Scott James Remnant Wed, 12 Apr 2006 07:31:53 +0100 + +sysvinit (2.86.ds1-6ubuntu24) dapper; urgency=low + + * Mount /proc/bus/usb; applications should NOT use this, they should use + /dev/bus/usb instead, however some legacy apps still care about it. + Any bugs filed about incorrect permissions or ownership of these devices + should instead be bugs filed on the software requiring it to be moved to + the new paths. + * Fix long-standing bug where the lrm volatile mount wasn't showing up + in /etc/mtab. + + -- Scott James Remnant Tue, 11 Apr 2006 21:42:04 +0100 + +sysvinit (2.86.ds1-6ubuntu23) dapper; urgency=low + + * Do not attempt to mount/umount ocfs2 and gfs. Both FS's require special + treatment and it is now handled properly by their own scripts. + + -- Fabio M. Di Nitto Tue, 04 Apr 2006 08:39:05 +0200 + +sysvinit (2.86.ds1-6ubuntu22) dapper; urgency=low + + Ubuntu: #35917 + * Always use the bind-mount trick when making /var/run and /var/lock + during an upgrade, as this copes with every corner-case that seb and + elmo can dream up between them. + * During boot always bind-copy /var/run and /var/lock then always move + the binds back after doing the "mount -a". Thus we cope with /var + being a symlink to something else that gets mounted. + + * Support /var-on-NFS; why? No idea. Someone will try it. + * Apply patch to correct checkroot.sh after fscking root filesystem. + Ubuntu: #28067. + * Correct inconsistent filesystem checking messages. Ubuntu: #32423. + + * Undo Sivang's evil, evil, evil patching of things in the debian + directory and just apply the patch, damnit! + + -- Scott James Remnant Tue, 21 Mar 2006 21:39:52 +0000 + +sysvinit (2.86.ds1-6ubuntu21) dapper; urgency=low + + * debian/patches/100_mountall_fix_output.dpatch: + - Fix the check for verbosity. + - Fix the output when mounting filesystems to display + complete lines rather then broken into each word. + - Thanks to Chris Moore + - Malone #28447 + + -- Sivan Greenberg Sun, 19 Mar 2006 22:01:39 +0200 + +sysvinit (2.86.ds1-6ubuntu20) dapper; urgency=low + + * Cleanup header in /etc/init.d/rc.local. + + -- Fabio M. Di Nitto Fri, 17 Mar 2006 06:20:20 +0100 + +sysvinit (2.86.ds1-6ubuntu19) dapper; urgency=low + + * Add /etc/rc.local support. + + -- Fabio M. Di Nitto Thu, 16 Mar 2006 08:38:02 +0100 + +sysvinit (2.86.ds1-6ubuntu18) dapper; urgency=low + + * Send -negative PROGRESS to usplash on shutdown, so that the bar can be + drawn Left-to-Right but in reverse-video. + + -- Paul Sladen Thu, 09 Mar 2006 17:19:05 +0000 + +sysvinit (2.86.ds1-6ubuntu17) dapper; urgency=low + + * Make the creation of /var/run and /var/lock under a /var mount more + robust by bind-mounting / instead of moving /var + + -- Scott James Remnant Thu, 2 Mar 2006 15:52:56 +0100 + +sysvinit (2.86.ds1-6ubuntu16) dapper; urgency=low + + * Move mountnfs to 45, as /usr might be on NFS. + + -- Scott James Remnant Thu, 23 Feb 2006 15:24:15 +0000 + +sysvinit (2.86.ds1-6ubuntu15) dapper; urgency=low + + * Only mount the /var/run and /var/lock tmpfs on an upgrade, not a fresh + install. + + -- Scott James Remnant Thu, 23 Feb 2006 15:20:07 +0000 + +sysvinit (2.86.ds1-6ubuntu14) dapper; urgency=low + + * Revert the last two bits of the last upload ... I was on crack. + + -- Scott James Remnant Thu, 23 Feb 2006 13:50:56 +0000 + +sysvinit (2.86.ds1-6ubuntu13) dapper; urgency=low + + * Remove the stop-bootlogd script. + * Move mountdevsubfs to S02, as there is now an early S01udev script that + at least makes /dev/null exist. + * Move hostname.sh to S03. + + -- Scott James Remnant Thu, 23 Feb 2006 13:46:08 +0000 + +sysvinit (2.86.ds1-6ubuntu12) dapper; urgency=low + + * Force recrection of /var/run and /var/lock directories underneath + mounted /var ... it seems more people than first thought got bitten + by the bad upgrade path; and this should fix it for them too. + + -- Scott James Remnant Thu, 23 Feb 2006 13:03:13 +0000 + +sysvinit (2.86.ds1-6ubuntu11) dapper; urgency=low + + * If /dev/.udev.log exists, move it to /var/log/udev.log. + + -- Scott James Remnant Tue, 21 Feb 2006 16:13:31 +0000 + +sysvinit (2.86.ds1-6ubuntu10) dapper; urgency=low + + * Change the permissions of /var/lock back to 1777 -- this is the + permissions they should be, the change to 0755 was a mistake. + Ubuntu: #30637. + + -- Scott James Remnant Tue, 21 Feb 2006 14:58:35 +0000 + +sysvinit (2.86.ds1-6ubuntu9) dapper; urgency=low + + * Use the progress bar for both K and S scripts in all run levels. + * Update the progress bar at all opportunities (Adam Conrad). + * Don't rely on /tmp being on the root filesystem when mounting /var + and moving /var/run and /var/lock out of the way. + * Keep /var/run and /var/lock in place as long as possible, and make + sure they're still there even when /var is unmounted again. + + -- Scott James Remnant Tue, 14 Feb 2006 12:55:38 +0000 + +sysvinit (2.86.ds1-6ubuntu8) dapper; urgency=low + + * Disable SElinux again, nobody gave me a patch to fix the annoying + message. + + -- Scott James Remnant Fri, 3 Feb 2006 17:54:55 +0000 + +sysvinit (2.86.ds1-6ubuntu7) dapper; urgency=low + + * Create /var/run and /var/lock with mode 0755, otherwise naughty people + could do "mkdir /var/run/console; touch /var/run/console/$USER:7" and + have magic things happen + * Move mountvirtfs to S01 again, so we can use S00 for readahead. + + -- Scott James Remnant Fri, 3 Feb 2006 14:49:06 +0000 + +sysvinit (2.86.ds1-6ubuntu6) dapper; urgency=low + + * Create /var/run and /var/lock, even if we have to quickly move /var + out of the way first; so they're always there. (Ubuntu #28943) + * Don't bother creating the /var/* directories in the init script, the + filesystem is almost certainly readonly. (Ubuntu #29637) + * On initial installs of this package create the /var/run and /var/lock + tmpfs, moving over anything from the old directories into them. + * For step-through-dapper upgrades, continue cleaning the /var/run and + /var/lock filesystems "underneath" but only this once. + + -- Scott James Remnant Wed, 25 Jan 2006 14:54:48 +0000 + +sysvinit (2.86.ds1-6ubuntu5) dapper; urgency=low + + * Clean up the old /var/run and /var/lock filesystems after upgrading. + + -- Scott James Remnant Tue, 24 Jan 2006 17:21:08 +0000 + +sysvinit (2.86.ds1-6ubuntu4) dapper; urgency=low + + * Remove the message when setting the hostname, it doesn't take any + time to complete and shouldn't ever fail. + + -- Scott James Remnant Tue, 24 Jan 2006 14:48:47 +0000 + +sysvinit (2.86.ds1-6ubuntu3) dapper; urgency=low + + * Drop S18bootlogd from the ordinary boot process; it needs a writable + /var/log and access to /dev/pts which means it would have to start so + late that there'd be nothing worth logging. Nobody can ever remember + this working in Ubuntu, and nobody's sure it even can work with usplash. + Everything's still shipped, so those who want it can figure it out, it's + just not tried by default. + + -- Scott James Remnant Mon, 23 Jan 2006 15:38:43 +0000 + +sysvinit (2.86.ds1-6ubuntu2) dapper; urgency=low + + * Fix shell quoting in the "dpkg --compare-versions" call used in postinst + for init script migration, so we aren't error-prone on fresh installs. + + -- Adam Conrad Mon, 16 Jan 2006 22:29:34 +1100 + +sysvinit (2.86.ds1-6ubuntu1) dapper; urgency=low + + [ Ongoing Merge Process ] + * Resynchronise with Debian. + + [ Scott James Remnant ] + * Use our 99_ubuntu_01_sulogin.dpatch in favour of Debian's sulogin_lockedpw + patch, as that prints scary warnings to all of our users. + * During shutdown and reboot take the progress bar from 100 to 0. + + * Update sulogin.dpatch to fix Ubuntu #12676 by only checking whether the + first character of the root password indicates a lock, rather than the + entire thing. + + * Change boot ordering to match the grand streamlined boot plan. + * Split domount function from mountvirtfs script into functions.sh. + * Separate out mounting of /dev/shm and /dev/pts into mountdevsubfs script + that is be run after udev has been started. + * Separate out updating of /etc/mtab with virtual filesystems into mtab + script that is run after the root filesystem has been checked and + remounted. + * Slim down mountvirtfs script now it just does exactly what it needs to + and no more. + + * Mount /var/run and /var/lock as tmpfs to avoid race conditions with + needing writable places during boot, we'll ensure anything needing a + subdir doesn't assume that it exists first. + * Make sure that we don't clobber those mounts if we /var is a separate + filesystem + * Drop cleaning of /var/run and /var/lock as this is just wasting time + + -- Scott James Remnant Mon, 9 Jan 2006 10:44:01 +0000 + +sysvinit (2.86.ds1-6) unstable; urgency=low + + [ Petter Reinholdtsen ] + * Updated versioned dependency of sysvinit from sysv-rc version + 2.85-2 to version 2.86.ds1-1.2, to make sure init.d/rcS calls all + init.d scripts with 'start' argument. Let initscripts conflict + with sysv-rc (<< 2.86.ds1-1.2) as well, to document that it need a + newer sysv-rc to work properly. (Closes: #338966) + * Added 91_sulogin_lockedpw.dpatch to make sure file systems can be + fixed on machines with locked root accounts too, by presenting a + shell in these cases. Patch from Ubuntu and Thom May. + (Closes: #326678) + * Make sure checkroot.sh calls mountvirtfs with argument 'start', to + avoid usage message and making sure it is executed as it + should. (Closes: #338966, #339351) + * Print message when hostname is set. Use default 'localhost' if no + hostname is set in /etc/hostname, and no current hostname is set. + * In mountall.sh, add '-e' to swapon call, to ignore missing devices + when enabling swap. Because of this, show error messages from + swapon. + * Add link to alioth project page in the Debian README. + * Created new file /lib/init/functions.sh for functions common to + scripts in initscripts. Moved dir_writable() into it. + * Add new function selinux_enabled(). Use it before running + /sbin/restorecon. + + [ Thomas Hood ] + * Improve update-rc.d man page text. + * Use log_action_* functions from recent (>= 3.0-6) lsb-base, to + improve output formatting. (Closes: #338967) + * Clean up initscript messages a bit, making them easier to + understand for non-technical users. + + -- Petter Reinholdtsen Sat, 19 Nov 2005 15:07:33 +0100 + +sysvinit (2.86.ds1-5ubuntu6) dapper; urgency=low + + * Brown paper bag fix: Move the initialising of the progress_size + variable outside the if block that prevents it from working if + you're booting from an older initramfs (say, a backup kernel). + + -- Adam Conrad Tue, 10 Jan 2006 00:38:00 +1100 + +sysvinit (2.86.ds1-5ubuntu5) dapper; urgency=low + + * Look for our progress state file in /dev/.initramfs, since the + initramfs state directory just moved in the last upload. + + -- Adam Conrad Mon, 9 Jan 2006 21:25:07 +1100 + +sysvinit (2.86.ds1-5ubuntu4) dapper; urgency=low + + * Amend runlevels S and 1 through 5 to properly carry over progress + bar state from initramfs-tools, so we get a smooth transition. + * Give runlevel S two thirds of the remainder and the final runlevel + only one third, since our boot process is almost entirely in rcS. + + -- Adam Conrad Mon, 9 Jan 2006 12:12:34 +1100 + +sysvinit (2.86.ds1-5ubuntu3) dapper; urgency=low + + * Give runlevel 0 and 6 a first_step as well, since having your shutdown + stop suddenly halfway through with a shell error is unseemly. + + -- Adam Conrad Thu, 5 Jan 2006 15:41:45 +1100 + +sysvinit (2.86.ds1-5ubuntu2) dapper; urgency=low + + * Disable the selinux patch, it makes an annoying message on boot. + + -- Scott James Remnant Thu, 8 Dec 2005 02:06:49 +0000 + +sysvinit (2.86.ds1-5ubuntu1) dapper; urgency=low + + * Resynchronise with Debian (done by me). + - Turn our source changes into dpatches, in line with packaging change in + Debian itself. (Can we bitch about *them* dpatching packages? :p) + - Drop our shutdown -H patch in favour of the Debian approach (requiring + shutdown -hH, which is probably "correct"). + - Drop various bits of documentation changes, which either seem invalid or + merged upstream already. + - Drop most of our lsbifying as this has all been done in Debian now. + - Fix up our usplash progress bar patch for the single rc script. + + -- Scott James Remnant Wed, 7 Dec 2005 14:07:13 +0000 + +sysvinit (2.86.ds1-5) unstable; urgency=low + + [Petter Reinholdtsen] + * Make sure init.d/bootmisc.sh depend on hostname, as it uses the + host name when generating motd. + * Improve update-rc.d(8) manual page, documenting how to remove + services and how to make sure services are not started. Patch + from Peter Valdemar Mørch. + * Add sysv-rc-conf(8) to the SEE ALSO section of update-rc.d(8). + * Add suggest to bum for sysv-rc. Also added bum(8) to the SEE ALSO + section of update-rc.d(8). (Closes: #332823) + * Get update-rc.d to understand symlinks to /etc/init.d/ as well as + symlinks to ../init.d/. (Closes: #338666) + * Adjust and clean up init.d dependecy information. + * Added 90_shutdown_H.dpatch to make sure shutdown flags -P and -H + require the -h flag, and document this in the manual page. + (Closes: #331041) + * Added 71_wall_hostname.dpatch to include hostname in wall message + from halt. (Closes: #325772) + * Add comment in freshly installed /etc/default/rcS mentioning its + origin. (Closes: #336873) + * Revert fix for bug #295335, as the manual page patch is reported + to be incorrect. Commented out 10_doc_lastb.dpatch from patches/00list. + * Improve argument handling for init.d scripts. Based on patch from + Enrico Zini. + * On FreeBSD, set TERM=cons25 in init as the kernel isn't setting + TERM. Patch from Robert Millan. (Closes: #335023) + + -- Petter Reinholdtsen Sun, 13 Nov 2005 12:55:47 +0100 + +sysvinit (2.86.ds1-4) unstable; urgency=low + + [Petter Reinholdtsen] + * Add '#! /bin/sh' to the init.d scripts missing those. + * Improve boot message for init.d/bootlogd. + * Make sure init.d/checkroot.sh only print status of swap mounting + when VERBOSE!=no. Improve boot message for this case. + * Improve usage message of update-rc.d. Uncredited patch from Ubuntu. + * Set pkg-sysvinit-devel@lists.alioth.debian.org as the package + maintainer, and move Miquel van Smoorenburg into the uploaders list. + * Get bootlogd working, by fixing the exit code patch. (Closes: #327865) + * Get ifdown working on kFreeBSD. (Closes: #327031) + * Quiet down update-rc.d by removing unnecessary warning. Patch + by Thomas Hood. (Closes: #164471) + * Improve update-rc.d(8) manual page. (Closes: #243154) + * Fix typo in pidof(8) manual page. + * Update FSF address in copyright files. + + -- Petter Reinholdtsen Sun, 2 Oct 2005 11:44:07 +0200 + +sysvinit (2.86.ds1-3) unstable; urgency=low + + * Fixed typo in last(1) manual page. (Closes: #326408) + * Documented -e and -t option in telinit. (Closes: #272657) + * Rewrote init.d/rc to avoid error from ls when no start or stop + script is present in one rcX.d directory. + * Updated the startpar source to version 0.49 from + . Still hanging the + boot on my test machine, so it is not included in the binary + package. Added 01_enable_startpar.dpatch to document how to + enable it. + * Changed section of packages from base to admin, to match override + file. + * New lsb-base package avoid error during shutdown. (Closes: #327570) + + -- Petter Reinholdtsen Sun, 25 Sep 2005 10:40:03 +0200 + +sysvinit (2.86.ds1-2) unstable; urgency=low + + * This package is now maintained on Alioth as the pkg-sysvinit project. + * Add myself as uploader. + * Add support for linprocfs on kFreeBSD. Patch from Robert + Millan. (Closes: #300963) + * Rewrote /etc/mtab handling in mountvirtfs to work with SELinux. + Based on patch from Luke Kenneth Casson Leighton. + (Closes: #270919) + * Add SELinux support to sysvinit on linux. Add build-depend on + libselinux1-dev and libsepol1-dev for all linux archs. Patch from + Manoj Srivastava, based on patch from Fedora. (Closes: #242900, + #249515,#315611) + * Drop redundant build-depend on essensial package bash. + * Add version 0.47 of startpar(8) program from SuSe. Part of + experimental parallel booting system. Not included by default + yet, as it tend to hang during boot. + * Add support for starting init.d scripts on the same level in + parallel, to speed up the boot process a bit. Currently, only a + simple system is implemented (and enabled by adding + CONCURRENCY=shell in /etc/default/rcS). This simple system messes + up the script output during boot. Disabled by default. (Closes: + #316290) + * Add 'kdm xdm gdm $syslog' as conditional dependencies of + rmnologin, to move it further back in the boot process. + * Make sure bootlogd return non-error exit code after forking off + the child. (Closes: #326640) + * Add more warning flags to list of compiler flags, to get more + info about problematic code. + * Avoid race-condition while fork()ing. Patch from SuSe. + (Closes: #327612) + * Improve error message when fork() fail in init. Patch from SuSe. + * Avoid hardcoding tty name length in wall, use UT_LINESIZE instead. + Patch from SuSe. + * Force kernel to reschedule after killing processes. Patch from SuSe. + * Make sure killall never tries to kill init (pid 1). Patch from SuSe. + * Acknowledge NMUs. (Closes: #30659, #85221, #204857, #225476, + #247102, #248739 #252059, #267935, #269774, #269894, #272588, + #272916, #273496, #277204, #281782, #284426, #286081, #287243, + #288098, #289562, #295094, #295335, #296489, #300645, #311741, + #314351, #316431, #317385, #317704, #318453, #318857, #323749, + #325933, #326460, #326495, #326647) + + -- Petter Reinholdtsen Sat, 11 Sep 2005 17:46:54 +0200 + +sysvinit (2.86.ds1-1.2) unstable; urgency=low + + * Non-maintainer upload to fix bugs. + * Moved all changes to upstream source to debian/patches/, and use + dpatch to apply them. + * Modified pidof to not print empty line if no pid was found. + (Closes: #225476) + * Merged rcS into rc. (Closes: #326460) + * Convert french version of update-rc.d(8) from UTF-8 to + ISO-8859-1. (Closes: #273496) + * Make sure binaries are stripped when installed, to avoid lintian + warning. + * Fix typo in debian/README (seperate->separate). + * Modify debian/rules to install Debian changelog for sysv-rc and + initscripts as changelog.Debian to keep lintian happy. + * Corrected section of mountpoint(1) manual page. + * Improve lastb(1) manual page. (Closes: #295335) + * Changed init.d/rc to short-circit stop scripts when switching + runlevels. Based on patches from Lukas Eppler and Steven + Barker. (Closes: #30659) + * Optimize boot speed by enabling the short-circit of start-scripts + when switcing from rcS.d to the real runlevel. + * Splitted umountfs in umountfs and umountroot. (Closes: #252059) + * Avoid umounting /dev/ in umountfs. (Closes: #287243) + * Made sure all init.d scripts handle start or stop + argument. (Closes: #326495) + * Added GFS file system to list of networked file systems. + (Closes: #295094) + * Added ocfs2 file system in to list of networked file systems. Patch + from Fabio M. Di Nitto and Ubuntu. + * Added trailing newline to the rebooting message, to make sure + kernel messages end up on lines of their own during + reboot. (Closes: #323749) + * Added init.d script dependency info in LSB format. (Closes: #325933) + * Do not fsck when running on battery. Patch from Thom May and + Ubuntu. (Closes: #326647) + * Updated initscripts to depend on lsb-base, and use the LSB + functions in all init.d scripts. Patch from Ubuntu. (Closes: #269774) + * Added some support for VERBOSE in checkfs.sh. + * Make sure urandom pool size is restored on boot. (Closes: #267935) + * Make it easier to override /etc/defaults/rcS parameters. (Closes: #286081) + * Accept 96 (32/mount failure + 64/some mount succeeded) as a valid + exit code from mount in mountall.sh. It seem to be returned when + some mount points already was mounted. + * Updated Standards-Version to 3.6.2.1 (no changes needed). + + -- Petter Reinholdtsen Sat, 10 Sep 2005 12:50:10 +0200 + +sysvinit (2.86.ds1-1.1ubuntu6) breezy; urgency=low + + * Make -H work correctly and end up with system halted rather than + dumping the user into single user mode. + + -- Tollef Fog Heen Mon, 26 Sep 2005 12:46:46 +0200 + +sysvinit (2.86.ds1-1.1ubuntu5) breezy; urgency=low + + * Handle exit status of mount correctly (Ubuntu #14360) + + -- Matt Zimmerman Tue, 30 Aug 2005 11:55:09 -0700 + +sysvinit (2.86.ds1-1.1ubuntu4) breezy; urgency=low + + * Use 'type' instead of 'which' to check for usplash_write + + -- Matt Zimmerman Tue, 30 Aug 2005 08:36:09 -0700 + +sysvinit (2.86.ds1-1.1ubuntu3) breezy; urgency=low + + * Restore changes which were inadvertently clobbered + * Add log_end_msg call to mountall.sh + + -- Matt Zimmerman Mon, 29 Aug 2005 16:01:59 -0700 + +sysvinit (2.86.ds1-1.1ubuntu2) breezy; urgency=low + + * Try to make progress bar more accurate by capping it when gdm/xdm/kdm is + started. This probably won't work quite right if multiple display + managers are installed, but will work for the default cases for Ubuntu and + Kubuntu + + -- Matt Zimmerman Mon, 29 Aug 2005 12:13:00 -0700 + +sysvinit (2.86.ds1-1.1ubuntu1) breezy; urgency=low + + * Usplash progress bar integration + + -- Matt Zimmerman Mon, 29 Aug 2005 12:07:09 -0700 + +sysvinit (2.86.ds1-1.1) unstable; urgency=low + + * Non-maintainer upload (bug cleanup) + * Fix stupid find warning by ordering the arguments correctly in + /etc/init.d/bootclean.sh (closes: #284426, #316431) + * Have cleantmp() in bootclean set TMPTIME to 0 if undefined to prevent + from breaking if the variable is not defined properly. (Closes: #314351) + * Introduce a better warning message in checkroot.sh when it fails + to fsck the root filesystem (Closes: #272916) + * Added a comment in /etc/init.d/skeleton regarding the use of 'sleep 1' + and describing possible changes maintainers might need to introduce + (Closes: #277204) + * Remove .clean files if not owned by root in bootclean.sh to prevent users + from tricking us to _not_ clean up some directories (Closes: #289562) + * Do not remove nologin twice (i.e. in checkroot.sh and in rmnologin) + (Closes: #317704) + * Check if there is a portmapper running before starting it up in + mountnfs.sh, also, use the portmap init.d script instead of running it + through start-stop-daemon if it is available (Closes: #85221) + * Do not install manpages with the execute permission bit (Closes: #281782) + * Clarify semantics of TMPFS_SIZE in /etc/default/tmpfs (Closes: #317385) + * Add feedback to user based on start-stop-daemon exit code + in the skeleton init script (Closes: #296489) + * Document the fact that shutdown touches /etc/nologin only 5 minutes + before shutting down the system (Closes: #204857) + * Add '-f' option to last manpage (Closes: #247102) + * Fix man page and help screen of update-rc.d (Closes: #268713, #288098) + * Changed 'editted' to 'regenerated' in /etc/default/rcS (Closes: #269894) + * Fix formatting issue in mesg(1) (Closes: #272588) + * Fix typo in bootlogd(8) manpage (Closes: #300645) + * Document exit status of pidof(1) (Closes: #311741) + * Point to proper chapter in init.d/README (Closes: #318453) + * Describe the proper behaviour in rcS's README (Closes: #318857) + * Added watch file provided by Stefano Fabri (Closes: #248739) + + -- Javier Fernandez-Sanguino Pen~a Wed, 10 Aug 2005 18:58:47 +0200 + +sysvinit (2.86.ds1-1ubuntu4) breezy; urgency=low + + * Add OCFS2/GFS to the list of network filesystems since they require + network to perform some operations. + + -- Fabio M. Di Nitto Mon, 29 Aug 2005 11:32:01 +0200 + +sysvinit (2.86.ds1-1ubuntu3) breezy; urgency=low + + * Fix argument positioning warning with new findutils. + + -- Colin Watson Fri, 10 Jun 2005 19:05:13 +0100 + +sysvinit (2.86.ds1-1ubuntu2) breezy; urgency=low + + * Depend on a new enough version of sed for "sed -i" to work (#8945) + + -- Adam Conrad Mon, 16 May 2005 06:54:55 +0000 + +sysvinit (2.86.ds1-1ubuntu1) breezy; urgency=low + + * Resynchronise with Debian (#9675). + + -- Martin Pitt Fri, 15 Apr 2005 11:07:04 +0200 + +sysvinit (2.86.ds1-1) unstable; urgency=low + + * New upload with a clean .orig.tar.gz archive without the .o files. + No other changes from 2.86-5. Used the .ds naming convention + that is suggested for packages which need to have their + docs removed (thanks, Marc Haber) + + -- Miquel van Smoorenburg Fri, 10 Dec 2004 00:04:18 +0100 + +sysvinit (2.86-5ubuntu6) hoary; urgency=low + + * Now, we'll actually check that we're on battery. GAR. + + -- Thom May Fri, 7 Jan 2005 18:16:27 +0000 + +sysvinit (2.86-5ubuntu5) hoary; urgency=low + + * Ensure we don't do filesystem checks if we're on Battery (Ubuntu #4680) + + -- Thom May Thu, 6 Jan 2005 20:12:22 +0000 + +sysvinit (2.86-5ubuntu4) hoary; urgency=low + + * Migrate DELAYLOGIN unconditionally, instead of md5sum hack. + + -- Daniel Stone Mon, 6 Dec 2004 11:57:50 +0100 + +sysvinit (2.86-5ubuntu3) hoary; urgency=low + + * Use '] || [' instead of '-o' in tests (thanks, Colin Watson). + + -- Daniel Stone Thu, 2 Dec 2004 12:27:09 +0000 + +sysvinit (2.86-5ubuntu2) hoary; urgency=low + + * Set DELAYLOGIN=no by default so we can start gdm early. + + -- Daniel Stone Thu, 2 Dec 2004 12:06:53 +0000 + +sysvinit (2.86-5ubuntu1) hoary; urgency=low + + * Resync from Debian. + + -- Daniel Stone Tue, 2 Nov 2004 21:10:49 +0100 + +sysvinit (2.86-5) unstable; urgency=high + + * Remove leftover debugging "echo" that prevented + /etc/init.d/mountnfs.sh from actually doing anything (closes: #270894) + + -- Miquel van Smoorenburg Fri, 10 Sep 2004 16:57:34 +0200 + +sysvinit (2.86-4) unstable; urgency=high + + * Same upload, this time built without -sa so that original source + isn't included (archive rejects it). + + -- Miquel van Smoorenburg Wed, 8 Sep 2004 11:59:08 +0200 + +sysvinit (2.86-3) unstable; urgency=high + + * Upload of -3 to unstable so that -2 can go into testing-proposed-updates + + -- Miquel van Smoorenburg Mon, 6 Sep 2004 20:07:38 +0200 + +sysvinit (2.86-2) testing-proposed-updates; urgency=high + + * Remove .clean file before touching it; prevents symlink attack + which in rare circumstances could result in random file creation + (closes: #264234) + * Do the above in a noclobber environment (Martin Pitt). + * Don't mount network filesystems multiple times (closes: #264894) + * Include .orig.tar.gz source in -2 again ("dpkg-buildpackage -sa") - + the one that comes with -1 erronously includes .o files and + binaries (oops!). + + -- Miquel van Smoorenburg Mon, 6 Sep 2004 19:02:19 +0200 + +sysvinit (2.86-1) unstable; urgency=medium + + * Better algorithm for pidof (closes: #248210) + * Include fsck.nfs.8 (closes: #250089) + * Include new skeleton script (closes: #244908) + * Better error message on failure to find path to mtab (closes: #255820) + * Add support for fstype ncp (alias for ncpfs) (closes: #259971) + * Touch /tmp/.clean earlier (closes: #255303) + * Don't include halt and reboot for hurd-i386 (closes: #255880) + * Remove XSIisms in mountvirtfs and invoke-rc.d (closes: #256726) + * Add "-t $roottype" to mount -f for / (closes: #255849) + * Always initialize PATH (to /bin:/usr/bin:/sbin:/usr/sbin) (closes: #258065) + * Try harder to remount ro and rw (closes: #259979) + * Add support for LABEL=/UUID= in checkroot.sh (closes: #261342) + + -- Miquel van Smoorenburg Fri, 30 Jul 2004 14:17:05 +0200 + +sysvinit (2.85-22ubuntu12) warty; urgency=low + + * Backport fix for Debian bug #255849: explicitly specify the filesystem + type with mount -t when initializing mtab (Closes: Warty#1848) + + -- Matt Zimmerman Mon, 4 Oct 2004 00:05:14 -0700 + +sysvinit (2.85-22ubuntu11) warty; urgency=low + + * debian/initscripts/etc/init.d/mountnfs.sh: fix output (Closes: #1405) + + -- Fabio M. Di Nitto Tue, 28 Sep 2004 12:18:09 +0200 + +sysvinit (2.85-22ubuntu10) warty; urgency=low + + * debian/initscripts/etc/init.d/mountnfs.sh: fix output (#1405) + * debian/initscripts/share/default.rcS: change VERBOSE to no (quieter output) + + -- Nathaniel McCallum Mon, 27 Sep 2004 16:01:47 -0400 + +sysvinit (2.85-22ubuntu9) warty; urgency=low + + * debian/initscripts/etc/init.d/check*.sh: add -T to fsck (hides title on + startup) + + -- Nathaniel McCallum Sat, 11 Sep 2004 13:43:45 -0400 + +sysvinit (2.85-22ubuntu8) warty; urgency=low + + * debian/initscripts/etc/init.d/mountnfs.sh: make sure script doesn't fail + if portmap is already started. Closes #1043. + + -- Nathaniel McCallum Fri, 10 Sep 2004 19:20:52 -0400 + +sysvinit (2.85-22ubuntu7) warty; urgency=low + + * Modified the output format of init to match our boot format. + + -- Nathaniel McCallum Fri, 3 Sep 2004 18:32:20 -0400 + +sysvinit (2.85-22ubuntu6) warty; urgency=low + + * fixed versioned lsb-base depend + + -- Nathaniel McCallum Fri, 3 Sep 2004 13:32:28 -0400 + +sysvinit (2.85-22ubuntu5) warty; urgency=low + + * pretty initscripts as listed below: + . bootclean.sh + . bootlogd + . checkfs.sh + . checkroot.sh + . mountall.sh + . mountnfs.sh + . reboot + . sendsigs + . single + . umountfs + . umountnfs.sh + . urandom + + -- Nathaniel McCallum Fri, 3 Sep 2004 13:03:19 -0400 + +sysvinit (2.85-22ubuntu4) warty; urgency=low + + * bootclean.sh: When creating the various */.clean files, rm -rf them before + and do all this in a noclobber environment to prevent symlink attacks. + (closes Warty bug #737) + + -- Martin Pitt Fri, 27 Aug 2004 11:48:40 +0200 + +sysvinit (2.85-22ubuntu3) warty; urgency=low + + * src/sulogin.c: Enable root login with a locked password + + -- Thom May Mon, 23 Aug 2004 20:32:54 +0100 + +sysvinit (2.85-22ubuntu2) warty; urgency=low + + * changed the 'quietinit' flag to 'splash' + + -- Nathaniel McCallum Fri, 20 Aug 2004 13:58:43 -0400 + +sysvinit (2.85-22ubuntu1) warty; urgency=low + + * debian/control: added lsb-base as a dependency to the initscripts package + * src/init.c: added a quietinit option which disabled initial boot output + + -- Nathaniel McCallum Mon, 16 Aug 2004 12:15:14 -0400 + +sysvinit (2.85-22) unstable; urgency=medium + + * Fix typo in /etc/init.d/halt (closes: #255133) + + -- Miquel van Smoorenburg Sat, 19 Jun 2004 12:40:12 +0200 + +sysvinit (2.85-21) unstable; urgency=medium + + * Create dependencies on glibc (>= 2.3.2.ds1-12) not through the + shlibs.local hack anymore. That might clash with a future system + shlibs file. Use the same method as we use to generate the + mount dependency - with a script (closes: #253314). + * In checkroot.sh always use the two-argument version of mount + so that mount doesn't confuse device and directory (closes: #254724) + * Change [ cond1 -a cond2 ] to [ cond1 ] && [ cond2 ] everywhere. + * Fix mountvirtfs, it broke for virtual filesystems mentioned in + fstab without any options (closes: #254271) + + -- Miquel van Smoorenburg Fri, 18 Jun 2004 13:43:55 +0200 + +sysvinit (2.85-20) unstable; urgency=low + + * Create /dev/pts in mountvirtfs for Linux + devfs (closes: #252625) + + -- Miquel van Smoorenburg Mon, 7 Jun 2004 13:45:12 +0200 + +sysvinit (2.85-19) unstable; urgency=low + + * Create /dev/{pts,shm} and /sys in postinst (closes: #252820, #252925) + + -- Miquel van Smoorenburg Mon, 7 Jun 2004 13:30:31 +0200 + +sysvinit (2.85-18) unstable; urgency=medium + + * Fix typo in /etc/init.d/single (closes: #252611) + + -- Miquel van Smoorenburg Fri, 4 Jun 2004 14:38:55 +0200 + +sysvinit (2.85-17) unstable; urgency=low + + * On Debian/k*BSD, dmesg is in /sbin (closes: #252518) + * On Debian/k*BSD, RB_HALT_SYSTEM is called RB_HALT + * RB_POWEROFF can be RB_POWER_OFF (closes: #252547, #252598) + * Add /sys, /dev/pts and /dev/shm to sysvinit. Remove the + mkdir's for those directories from mountvirtfs. + + -- Miquel van Smoorenburg Fri, 4 Jun 2004 11:51:46 +0200 + +sysvinit (2.85-16) unstable; urgency=high + + * Remove /etc/init.d/{mountkernfs,devpts.sh) that glibc installed + since mountvirtfs now provides these. (closes: #230857) + * Remove -e from mountvirtfs (closes: #232122) + * Add some more comments/documentation to mountvirtfs + * Initscripts depends on libc6 anyway right now, so we let it + depend on libc6 (>= 2.3.2.ds1-12) via shlibs.local + * Suggest sysv-rc-conf (closes: #244643) + * Updated french manpage for update-rc.d (closes: #245007) + * Use larger dmesg buffer (-s option) (closes: #242923) + * Fix up comments in /etc/default/tmpfs (closes: #245681) + * Added GNU/Hurd and kFreeBSD fixes (closes: #246743) + * Run mountvirtfs again at S36 so that it mounts /proc/bus/usb in + case usb was loaded as a module (closes: #249031) + * Don't mkdir /dev/pts if it's not there - and don't mount devpts + filesystem on it either in that case. Should help udev. + * mountvirtfs now uses the options from /etc/fstab (closes: #251016) + * add filesystem type "cifs" as network fs (closes: #248919) + + -- Miquel van Smoorenburg Thu, 3 Jun 2004 20:03:33 +0200 + +sysvinit (2.85-15) unstable; urgency=high + + * Drop bogus dependency on fileutils (closes: #241570) + + -- Miquel van Smoorenburg Mon, 5 Apr 2004 17:07:24 +0200 + +sysvinit (2.85-14) unstable; urgency=high + + * When remounting "/", just use "mount -n -o remount,rw /" and don't + bother with the device or other arguments - "mount" will look up the + root device in /etc/fstab, but the device argument to the mount + system call is ignored by the kernel for remount anyway. So this + doesn't hurt even if the device is incorrect, and it fixes a + platform dependant case where "mount -n -o remount,rw /" + fails with "mount: you must specify the filesystem type". That + is a bug in mount(8): if you don't specify the type, it passes + garbage to the kernel, and some archs choke on that. + (closes: #239735) + * change checkroot.sh so that it never checks the root filesystem + if root is on NFS even if fs_passno is set (closes: #240470) + * Reckognize type "nfs4" as network filesystem + * Better check for file-rc in postinst of initscripts (closes: #240066) + * Use /proc/sys/kernel/random/poolsize in urandom script (closes: #240057) + * Applied Debian/KFreeBSD patches. Moved initctl to /etc/.initctl + for the FreeBSD kernels. (closes: #226939) + + -- Miquel van Smoorenburg Wed, 31 Mar 2004 13:10:48 +0200 + +sysvinit (2.85-13) unstable; urgency=low + + * Add /etc/default/halt (closes: #196983) + * Set default variables used in every /etc/init.d script explicitly + and only source /etc/default/rcS if it is present (closes: #239439) + * Fix MOTD typo in bootmisc.sh (closes: #239279) + * Include lastb (closes: #239586) + * Remove /lib/init/realpath (closes: #239343) + + -- Miquel van Smoorenburg Tue, 23 Mar 2004 16:55:38 +0100 + +sysvinit (2.85-12) unstable; urgency=low + + * Support for root on devices with a dynamic major, such as + LVM and partitionable RAID. If the root device in /etc/fstab doesn't + match up with the actual root device, we try to create a temporary + device node in /dev/shm/root so fsck and remount rw can be done. + * Use lstat() instead of stat() in the mountpoint(8) utility. + * Fix checkroot devfs behaviour. + * Hmm, /usr/bin/test -w works to check if a filesystem is readonly, + but bash's built-in doesn't. Work-around with touch -a. + * /lib/init/readlink was completely broken, argh. Fixed borkenness. + Also changed behaviour so that readlink -ff is equivalent to realpath, + and -f doesn't insist on the path being a symlink. (closes: #238611) + * Removed one more init_setenv debug message from init.c + * Move mountpoint and readlink to initscripts, so that initscripts + doesn't have to depend on a specific version of sysvinit anymore + (closes: #239059) + * Make initscripts non-essential (needed for Hurd) (closes: #219969). + * Remove period from short description (closes: #239098) + * Improved handling of /etc/nologin symlink (closes: #184402) + * Make sure 'skeleton restart' restart the service even if it is not + running in accordance to policy 3.5.9.0 (closes: #184342) + * Change -name x into -path ./x in bootclean.sh (closes: #193627) + * Remove /usr/local from bootlogd path, move /sbin:/bin to the + front of the PATH. /usr/bin:/usr/sbin is kept around because the + stop action needs it for savelog. (closes: #230763) + * Remove x bit from bootclean.sh (closes: #230762) + * Consolidate variables in skeleton (closes: #122486) + * Move set -e up in skeleton (closes: #148847) + * Include spanish manpage for update-rc.d (closes: #209199) + * In /etc/init.d/README change http: URL to file: URL (closes: #151761) + + -- Miquel van Smoorenburg Sun, 21 Mar 2004 13:10:09 +0100 + +sysvinit (2.85-11) unstable; urgency=high + + * Move runlevel back to /sbin (closes: #238261) + * Move killall5 back to /sbin (closes: #238416) + * More finetuning of the included readlink program. It now has a much + more correct version of realpath() than glibc (famous last words). + + -- Miquel van Smoorenburg Wed, 17 Mar 2004 00:29:53 +0100 + +sysvinit (2.85-10) unstable; urgency=low + + * Provide mountvirtfs. It mounts /proc,/sys, etc at early boot. + Libc6 does this too with a script called mountkernfs which is called + later, but that shouldn't matter. Libc6 must remove it later on. + Perhaps we should remove the symlink - I'm not sure. + * Add /etc/default/{devpts,tmpfs} to initscripts. Add Replaces: libc6, + libc6.1 to control for initscripts. + * Add /lib/init/readlink which we can use until the standard + readlink has the features we need. + * Fix maxproclen issue (closes: #236138) + * Remove INIT_HALT debug message (closes: #230743) + * When cleaning /tmp, don't look at directory atime for aging info + (closes: #236709,#205486,#221622) + * bootclean.sh: only run if find and xargs are available (closes: #232635) + * Depend on mount (>= 2.11l-1) for the -l option (closes: #217702) + * Mount non-/ proc filesystems in mountall.sh. This will not work + if you want to mount /foo/bar/proc if /foo/bar is an NFS filesystem, + but this will do for now (closes: #234152) + * Add coda to list of networked filesystems in mountall.sh/mountnfs.sh + + -- Miquel van Smoorenburg Tue, 16 Mar 2004 01:04:06 +0100 + +sysvinit (2.85-9) unstable; urgency=low + + * Fix typo in /etc/init.d/halt (closes: #224626) + * Fix /etc/mtab-is-a-symlink corner cases (closes: #204619) + * Fix /etc/init.d/mountall.sh to only mount local fses (closes: #224720) + * Replace reference to dpkg programmer's manual in update-rc.d.8 + with reference to Debian Policy (closes: #223658) + + -- Miquel van Smoorenburg Tue, 23 Dec 2003 12:16:14 +0100 + +sysvinit (2.85-8) unstable; urgency=low + + * Clean /tmp, /var/run and /var/lock directly after mounting all + local filesystems and once more after mounting network filesystems, + but not more than once per directory (closes: #208226,#223495) + * Do not run bootlogd by default - it's a bit to experimental for + the "stable" release. Can be turned on manually (closes: #217582) + * Fix /etc/init.d/bootlogd (closes: #208578) + * Rework umountnfs.sh/umountfs (closes: #204425, #206111, #20863, #203050) + * Depend on mount >= 2.11l (closes: #217702) + * Don't use umount -l on 2.4 kernels < 2.4.11 (closes: #217701) + * /var/log/boot mode 640, group adm (closes: #204400) + * Deal correctly with /etc/mtab being a symlink (closes: #204619) + * Set TMPTIME to "infinite" to not clean /tmp (closes: #205894) + * Mount all proc filesystems (closes: #206979) + * Fix typo in invoke-rc.d manpage (closes: #196135) + * Set correct permissions on /etc/{rcS.d,init.d}/README (closes: #201467) + * Update /etc/init.d/README (refer to correct paragraph) (closes: #206411) + * bootlogd: handle comma's in console= (closes: #213749) + * Remove trailing space from 'echo -n "something ... "' (closes: #219202) + * Include documentation on invoke-rc.d and policy-rc.d (closes: #219245) + * Remove empty /usr/include from sysv-rc (closes: #222538) + * Let sysvinit Pre-Depend on file-rc | sysv-rc (closes: #221808) + + -- Miquel van Smoorenburg Thu, 18 Dec 2003 23:11:20 +0100 + +sysvinit (2.85-7) unstable; urgency=low + + * Fix devfs mtab fixup in checkroot.sh (closes: #202421) + * pidof symlink should be in /bin (closes: #202611) + + -- Miquel van Smoorenburg Wed, 23 Jul 2003 19:11:59 +0200 + +sysvinit (2.85-6) unstable; urgency=high + + * When bootlogd gets an error writing to the real console, try + to re-open. If that fails, roll over and die (closes: #202382) + + -- Miquel van Smoorenburg Tue, 22 Jul 2003 12:43:07 +0200 + +sysvinit (2.85-5) unstable; urgency=low + + * Allow "init u" to fail in postinst without bailing out with an error + (closes: #197991, #198216, #198309, #198937) + * Revert changes to bootmisc wrt /etc/nologin, leave out the + /etc/nologin.boot stuff (which never worked anyway), /etc/nologin + is now always cleaned out on boot. + (closes: #198444, #184402, #199943, #199401) + * Block signals in syslog(), since syslog() is not re-entrant + (James Olin Oden , redhat bug #97534) + * Remove rc.boot manpage completely instead of installing it first + and then removing it in sysv-rc's postinst + * When unmounting all filesystems, do not unmount /proc, /dev and /sys + (closes: #198970, #184594, #173878, #200147, #198793) + * Umount network filesystems lazily (-l) (closes: #164503) + * Clarify initscript manpage (closes: #174058) + * Use /proc as reference to see if files in /var/lock and /var/run + are stale (closes: #198792). I should look at #120545 to + actually fix this right, I guess. + * Include bootlogd (closes: #151880, #15447, #132662) + * Move update-rc.d for initscripts to the initscrips packages' postinst + instead of doing it in the postinst of sysv-rc + + -- Miquel van Smoorenburg Mon, 21 Jul 2003 12:48:11 +0200 + +sysvinit (2.85-4) unstable; urgency=medium + + * Move default.rcS to /usr/share/initscripts, fix postinst (closes: #190921) + * Only clean /tmp if it is mode 777 (really in -3) (closes: #139870) + * Move initscripts and sysv-rc to binary-indep target (closes: #190801) + * Save fsck exit code in variable (closes: #189917,#194827,#197483) + * If /etc/motd is a symlink, follow it when + editting /etc/motd (closes: #150355) + * If /etc/nologin is a symlink, remove the destination file after + bootup instead of the link itself (closes: 191041) + * Don't remove /etc/mtab~ if /etc/mtab is a symbolic link + * Only start 'update' when running kernels < 2.4 + * Mount /proc before mounting other filesystems, umount all proc + filesystems at shutdown except /proc (closes: #140591,#197317) + * Add 'set -e' to postinst (closes: #148465) + * Don't umount devfs at shutdown time (closes: #156490) + * When cleaning /tmp, first remove old files then remove old + empty directories (closes: #193623) + * Don't remove /tmp/...security* (closes: #195760) + + -- Miquel van Smoorenburg Wed, 18 Jun 2003 16:08:09 +0200 + +sysvinit (2.85-3) unstable; urgency=high + + * Move sample inittab files to /usr/share/sysvinit (closes: #189761) + * Make sysv-rc point update-rc.d and invoke-rc.d to the dummy + /usr/share/sysvinit/update-rc.d script in the postrm script, so + that dpkg remains happy when installing file-rc or another package + to replace sysv-rc. + * Minor adjustements so that sysvinit compiles on the Hurd (closes: #43575) + * For now set Architecture: all on sysv-rc and initscripts + (closes: #190179, #190182) + * Add upstream source to copyright file (closes: #15183) + * Remove /etc/rc.boot from sysv-rc (closes: #113821) + + -- Miquel van Smoorenburg Wed, 23 Apr 2003 15:26:21 +0200 + +sysvinit (2.85-2) unstable; urgency=high + + * sysv-rc must not Depend: on sysvinit, otherwise sysvinit/sysv-rc + is not installable. + + -- Miquel van Smoorenburg Tue, 22 Apr 2003 12:40:54 +0200 + +sysvinit (2.85-1) unstable; urgency=low + + * Support for IPv6 in 'last'. + * Fix -i/-d options in last (closes: #171134) + * /dev/.devfsd: check only for existance, not for type (closes: #170852) + * Don't remove pump.sock from /var/run/utmp (closes: 167572) + * Get rid of /etc/ioctl.save, it's a legacy thing from Unices with + a serial console and no way to set reset the linespeed at boot. + With Linux we have console=tty0,speed as bootparameter anyway. + * Remove support for file-based runlevel signalling. All systems + use /dev/initctl by now (I hope, but we'll see). + * When cleaning /tmp, check atime and mtime as well (closes: #179006) + and do not remove aquota.user and aquota.group (closes: #175874) + * Only clean up /tmp at boot if it is world-writable. + * If fsck of the rootfs returns 2 or 3, reboot (closes: #170442,#167300) + * Sulogin: even if the root password is empty, ask for a password- + otherwise there is no way to set a timeout (closes: #180246) + * Split up sysvinit into sysvinit, sysv-rc and initscripts. + + -- Miquel van Smoorenburg Fri, 18 Apr 2003 21:26:53 +0200 + +sysvinit (2.84-3) unstable; urgency=low + + * Upload into unstable of 2.84-3 so 2.84-2woody1 can go into + woody-proposed-updates tomorrow or so. + + -- Miquel van Smoorenburg Tue, 28 May 2002 11:44:26 +0200 + +sysvinit (2.84-2woody1) woody-proposed-updates; urgency=high + + * On some systems, /proc didn't get mounted because there is junk + under the /proc mountpoint, makeing the system unuseable. Fixed + by an extra check. Also warns the user. (closes: #134316) + * Fix typos in README.runlevels (closes: #94745) + * Update /etc/init.d/skeleton to comply with policy (closes: #96711,#121947) + * On some systems "init" might show up as "ini" in "ps" output + due to a off-by-one error in maxproclen calculation (closes: #132870) + * Fix typo (SBM - SMB) in /etc/init.d/mountnfs.sh (closes: #139251) + * Fix typo in debian/rules that installed prerm as preinst, and + preinst not at all (closes: #148174) + * Up severity to "high" since any program with write access to + /var/run/utmp (group utmp) could trick the "shutdown" command into + corrupting random files (note that currently there are no known + exploits for setgroup-id-utmp programs). + + -- Miquel van Smoorenburg Mon, 27 May 2002 22:37:23 +0200 + +sysvinit (2.84-2) unstable; urgency=low + + * modernized inittab manpage. + * Don't shut down IDE drives on halt if RAID is active (closes: #127635) + * Add /etc/init.d/umountnfs.sh to conffiles (closes: #122190) + * Only mount /proc in checkroot.sh if it's not mounted yet. This + gives earlier scripts the possibility to mount /proc and just + leave it mounted. + * Set maxproclen correctly on re-exec. Make sure setproctitle() leaves + at least two zeroes at the end of the argv array. + * Don't put IDE drives into standby mode at halt time if RAID is still + active, since the RAID halt/reboot/poweroff codepath in the kernel + still needs to flush the RAID metadata to disk. (closes: #127635) + * Use 'dmesg -s 65536' when writing /var/log/dmesg (closes: #128568) + * Mount /proc only if not mounted yet, don't unmount (closes: #118977) + * Commented out kb line in sample inittab (closes: #130126) + * Update /etc/rcS.d/README (closes: #130225) + * Don't duplicate options when remounting rootfs (closes: #119381) + + -- Miquel van Smoorenburg Fri, 25 Jan 2002 14:02:17 +0100 + +sysvinit (2.84-1) unstable; urgency=high + + * Don't use /etc/initlvl interface for telinit; only use /dev/initctl, + and give a clear error when that fails (closes: #116829) + * Add -i/--init command line flag to init - this tells init + 'behave as system init even if you're not PID#1'. Useful for + testing in chroot/jail type environments. + * Use --print-installation-architecture in postinst instead of + --print-architecture. + + -- Miquel van Smoorenburg Tue, 27 Nov 2001 13:08:45 +0100 + +sysvinit (2.83-3) unstable; urgency=low + + * Don't disable write caching on IDE disks before unmounting file + systems, since that flag is kept over reboot. Instead the + halt program now has an extra -h switch that makes it send all + IDE drives a "standby" command that as a side effect flushes + the write-cache. That flag is used in /etc/init.d/halt + + -- Miquel van Smoorenburg Wed, 7 Nov 2001 16:11:28 +0100 + +sysvinit (2.83-2) unstable; urgency=high + + * Only disable write caching on disks, not on all IDE devices + such as CDROMs (closes: #115354,#115822,#117390) + * Mount verbose, except for proc (closes: #115362,#111481) + * Add comments about not using tty7 to default inittab (closes: #117618) + * Install inittab.$(arch) as default inittab in the installation + process, if it exists. Add inittab.s390 (closes: #113495) + * Appears that the 'shutdown to fast' bug is closed by + turning off the IDE write cache at shutdown (closes: #110804). + Only thing is that this should probably get in the kernel + somehow, as it's really a kernel bug. + + -- Miquel van Smoorenburg Thu, 1 Nov 2001 13:21:58 +0100 + +sysvinit (2.83-1) unstable; urgency=high + + * Upstream fix: race condiction in wait() [Andrea Arcangeli] + * shutdown.allow processing broke due to typo (closes: #111199) + * Call closelog() after openlog()/syslog() since recent libc's + keep the logging fd open and that is fd#0 aka stdin (closes: #111901) + * Typo in shutdown manpage fixed (closes: #112815) + * Don't remove .journal file during tmp cleanup (closes: #113564) + * Don't use '-v' flag to mount in mountall.sh (closes: 111481) + * Fix policy reference in README (closes: #97925) + * Treat 'ncpfs' as remote filesystem (closes: #94510) + * Don't do fsck -C if $TERM is unset or set to dumb|network|unknown. + Also don't do fsck -C if `uname -m` = s390 + * Turn off write-caching on all IDE disks prior to unmounting + filesystems. On some systems that poweroff on halt the system + powers off before the IDE disk write cache is flushed. You do + need to have hdparm installed to get this to work. + + -- Miquel van Smoorenburg Fri, 5 Oct 2001 14:37:42 +0200 + +sysvinit (2.82-1) unstable; urgency=low + + * New upstream version. + * Now prints out correct version at startup (closes: #109558,#108377) + * Versioned replaces (dpkg << 1.9.17) (closes: #109557) + * Mount all proc filesystems in fstab (closes: #108109) + * Fix spelling of initttab in init(8) (closes: #100659) + * Clarify "usage" message of update-rc.d (closes: #108391) + + -- Miquel van Smoorenburg Thu, 23 Aug 2001 17:50:03 +0200 + +sysvinit (2.81-1) unstable; urgency=low + + * New upstream version. + * 'pidof' now finds processes that do weird stuff with their + name in 'ps' listings (i.e. use setproctitle()) (closes: #67021) + + -- Miquel van Smoorenburg Tue, 31 Jul 2001 18:25:11 +0200 + +sysvinit (2.80-3) unstable; urgency=high + + * The diff that dpkg-source builds doesn't include empty directories + so we now create them in the debian/rules file. + * Make /etc/init.d/* executable (closes: #107018) + + -- Miquel van Smoorenburg Mon, 30 Jul 2001 16:15:29 +0200 + +sysvinit (2.80-2) unstable; urgency=high + + * Use install -m 755 instead of copy for the pre/post install/remove + scripts (closes: #106730) + + -- Miquel van Smoorenburg Thu, 26 Jul 2001 22:46:52 +0200 + +sysvinit (2.80-1) unstable; urgency=medium + + * New upstream version + * Don't prevent raid-rebuild from activating swap on 2.4 and up + (closes: #80446, #83118). + * Document IO redirection in wall manpage (closes: #79491) + * Use -x in skeleton file (closes: #67143) + * Update README (closes: #85650) + * Unmount tmpfs before turining off swap (closes: #84782) + * Fix check for passno in checkroot.sh (closes: #84035) + * Make sure scripts exit with code 0 if succesful (closes: #83410) + * Don't try to set hostname if /etc/hostname is not present (closes: #81711) + * Mount /proc early and keep it mounted (closes: #75936, #71433, #88352) + * Fix init.8 manpage (closes: #75268) + * Small fix to rc script (closes: #72859) + * Optimize /tmp cleaning (closes: #71176) + * Check for update before executing it in "single" script + (closes: #68983, #103144) + * Build package with SHELL=/bin/bash (closes: #68623) + * Fix typo in halt(8) manpage (closes: #67875) + * Check time argument of shutdown(8) for correctness (closes: #67825) + * Don't chown ptys on devfs system (closes: #88300) + * Check for stale sessions in last(1) (Chris Wolf ) + * Include invoke-rc.d (closes: #94140). Conflicts: file-rc (<= 0.5.7) + * Move random-seed to /var/lib/urandom (closes: #102216) + * Moved update-rc.d from dpkg to sysvinit + * Didn't include the UPS changes yet, that will come in a later + 2.80-xyz version -- needed to get 2.80 out of the door first. + + -- Miquel van Smoorenburg Thu, 26 Jul 2001 14:07:03 +0200 + +sysvinit (2.78-4) frozen unstable; urgency=high + + * In /etc/init.d/checkroot.sh, change 10>&0 into 9>&0, since + ash doesn't handle file descriptors > 9 + + -- Miquel van Smoorenburg Sun, 25 Jun 2000 14:03:04 +0200 + +sysvinit (2.78-3) frozen unstable; urgency=medium + + * Fix critical bug #61227: Kernel panic/filesystem corruption if + swapping started while software RAID resyncing. As this doesn't + matter on 99% of the installs out there it's up to the release + manager to decide whether to put this in potato or not (closes: #61227). + * Fix up /etc/init.d/README paths (closes: #58935,#58595) + * Don't check root filesystem if "pass" in /etc/fstab is 0 (closes: #65125) + * Unmount remote filesystems before network is shut down + (closes: #60898,#61907). This also was a release-critical bug. + * Changed "file systems" to "filesystems". + + -- Miquel van Smoorenburg Tue, 6 Jun 2000 11:08:24 +0200 + +sysvinit (2.78-2) frozen unstable; urgency=high + + * Change "booting" to "reloading" message at reload + * Don't create /etc/init.d/network if missing (closes: #56373) + * Treat SMB filesystems like NFS ones in mountall.sh and + mountnfs.sh (fixes: #55414) + * bootmisc.sh: do not remove files in /var/run that are newer + than /etc/mtab. This should preserve pid files created before + this script ran (closes: #49816) + * Add "-z xxx" dummy command line argument (closes: #54717) + + -- Miquel van Smoorenburg Fri, 11 Feb 2000 12:17:54 +0100 + +sysvinit (2.78-1) unstable; urgency=low + + * 2.78 will be the new upstream version, I'm skipping 2.77 + * Update /etc/init.d/rc (closes: #48764) + * Add -C argument to fck (closes: #47914, #53335) + * don't remove files in /var/run and /var/lock that are newer + than /etc/mtab (may fix the dhcpcd problems) + * Save kernel messages in /var/log/dmesg like RedHat does (closes: #47574) + * Shutdown now calls sync before switching the runlevel to 0 or 6, + or before unmounting filesystems if -n was used (closes: #46461) + * Call umount with -f option to force NFS umounts (closes: #45715) + * Fix TMPTIME documentation in rcS(5) (closes: #42570, #53224) + * Some cosmetic changes to init.c (closes: #32079) + * Move to /usr/share to comply with latest policy + + -- Miquel van Smoorenburg Thu, 30 Dec 1999 20:40:23 +0100 + +sysvinit (2.77-3) unstable; urgency=low + + * Remove hwclock.sh initialization and script itself (closes: #45164) + + -- Miquel van Smoorenburg Tue, 5 Oct 1999 21:52:02 +0200 + +sysvinit (2.77-2) unstable; urgency=low + + * Recompile against glibc 2.1 instead of 2.0 + * Fix compilation problems with glibc 2.1 + * Fix last -i option + + -- Miquel van Smoorenburg Tue, 5 Oct 1999 21:51:50 +0200 + +sysvinit (2.77-1) unstable; urgency=low + + * Write reboot record into utmp file as well to make rms happy + * Change GMT to UTC in /etc/default/rcS + * Change /var/run/utmp to mode 664 group utmp if utmp group exists + * Fork and dump core in / if SIGSEGV is received for debugging purposes + * Patch by Craig Sanders for "last" -i option + * Fixes: + #35429: sysvinit: bad comments in /etc/defaults/rcS + #37807: mountnfs.sh should start rpc.statd if available + #38384: sysvinit: Slight gramitical error in /etc/init.d/README + #41660: [Patch] bootmisc.sh: Change /var/run/utmp ownership to [...] + #41458: mountnfs.sh: should ignore noauto + #40923: sysvinit: /etc/ioctl.save a state file? + #42183: util-linux: hwclock.sh depends on UTC which is not defined + + -- Miquel van Smoorenburg Wed, 4 Aug 1999 11:16:23 +0200 + +sysvinit (2.76-4) unstable; urgency=low + + * Change dowall.c to handle Unix98 ptys correctly + * Add comment in rcS about usage of setup.sh and unconfigured.sh + * Shutdown now removes nologin file just before calling telinit + * SEGV handler now tries to continue after sleep of 30 seconds. + On a 386-class processor it also prints out the value of EIP. + * Fix for racecondition in check_init_fifo() by Richard Gooch + * Fixes: + #32698: sysvinit: checkroot.sh: should add devfs entry to mtab + #35689: wall/shutdown cannot handle Unix98 PTYs + #30392: sysvinit scripts are not executable + #32699: bootmisc.sh: should check for existence of /dev/tty[p-za-e][0-9a-f] + #34062: mountnfs.sh: ignore comments in fstab [patch] + #34780: sysvinit: ignores most options for rootfs + #35017: sysvinit: nologin after sungle user mode [sic] + #36209: init: segmentation violation (possibly kernel) + #36294: sysvinit: sulogin does not appear to recognize shadow passwords + #36705: README in init.d has section number off by 0.1 + #36849: sysvinit: shutdown doesn't send shutdown message to unix98 ptys + #36856: sysvinit: /etc/init.d/rc calls bash for no reason + #37265: sysvinit: devpts incompatibility? + #32698: sysvinit: checkroot.sh: should add devfs entry to mtab + #33954: sysvinit: [wishlist] bootmisc.sh: touch /var/run/utmpx + + -- Miquel van Smoorenburg Sat, 8 May 1999 17:22:57 +0200 + +sysvinit (2.76-3) frozen unstable; urgency=high + + * Small bugfix to last.c courtesy of Danek Duvall + * Recompile with latest libs, so dependency on libc6 (>= 2.0.7u) is gone. + * Fixes bugs: + #31601: sysvinit: Doesn't wipe new files from /tmp + #28132: checkroot.sh parsing of /etc/fstab is incorrect. + #29729: sysvinit: references wrong policy homepage + #27949: last: should use down instead of crash + + -- Miquel van Smoorenburg Tue, 12 Jan 1999 12:12:44 +0100 + +sysvinit (2.76-2) frozen unstable; urgency=high + + * Minor fix in debian/rules for dependency problem on the Alpha. + + -- Miquel van Smoorenburg Thu, 5 Nov 1998 10:54:28 +0100 + +sysvinit (2.76-1) frozen unstable; urgency=high + + * Fix bug in check_pipe() which crashes init on the Alpha. + * Re-upload since this should go into frozen too, ofcourse. + * Changed the version number to 2.76, even though it's a minor + upgrade. I want to release this version outside Debian too. + + -- Miquel van Smoorenburg Tue, 3 Nov 1998 11:09:13 +0100 + +sysvinit (2.75-4) unstable; urgency=low + + * Change sulogin password buffer to 128 characters. + * Don't print control characters in dowall.c + * Try to open getenv ("CONSOLE"), /dev/console and /dev/tty0 in order. + For backwards compatibility when you try to boot a 2.0.x kernel + with a linux > 2.1.70 /dev/console device. + * Change src/Makefile for non-debian systems (mainly, RedHat) + * Try to create /dev/initctl if not present; check every time to see + if the dev/ino of /dev/initctl has changed and re-open it. This should + help devfs a bit. + * Send SIGUSR1 to init at bootup to let it re-open /dev/initctl; + again in support of devfs. + * Rewrite of mountnfs.sh by Chris Ulrich + * Moved pidof to /bin (it's only a link to killall5 anyway) + * Fixes bugs: + #11895: pidof exists, is unreliable, and is not deprecated + #23943: `"$FSCKFIX" = yes' needed in "checkroot.sh", too + #24190: sysvinit: postinst and telinit u + #25531: sysvinit: README refers to the fatman website + #26115: sysvinit: There is no support for a read only root + #26179: sysvinit: pidof in /sbin ? why ? + #26281: sysvinit: Obsolete location for Policy Manual in /etc/init.d/README + #15739: libc6: strange interferention between sleep() and fork() + + -- Miquel van Smoorenburg Mon, 5 Oct 1998 14:03:14 +0200 + +sysvinit (2.75-3) frozen unstable; urgency=high + + * Source /etc/default/rcS in all scripts, otherwise file-rc is broken. + * Do not call update-rc.d for isapnp + * Fixes: + #23556: sysvinit tries to install isapnp + #23270: sysvinit: /etc/default/rcS: comment should indicate time units + #23191: /etc/default/rcS + #23651: sysvinit: sysvinit fails to clean stale X locks in /tmp + + -- Miquel van Smoorenburg Mon, 22 Jun 1998 14:48:53 +0200 + +sysvinit (2.75-2) frozen unstable; urgency=medium + + * Fix last.c again. + * Add check to see if /dev/initctl is really a FIFO + * In ifdown.c first down all shaper devices then the real devices + * Fixes bugs: + #22840: sysvinit (2.75-1): patch request for sparc + #22965: rcS is not sh independent + #22945: Problems with last ( bug in sysvinit package)? + #23005: sysvinit: [patch] install initreq.h for `genpowerd' patch. + + -- Miquel van Smoorenburg Tue, 2 Jun 1998 22:43:01 +0200 + +sysvinit (2.75-1) frozen unstable; urgency=low + + * Rewrote last.c to be much more memory friendly and correct, + thanks to Nick Andrew and + David Parrish + * Fixes bugs: + #21616: sysvinit: sulogin thinks md5 root password is bad + #21765: sysvinit: Typo in `killall5.c' + #21775: sysvinit: sysvinit does not support MD5 hashed passwords + #21990: /usr/bin/last: unnecessary memset and off-by-one bug + #22023: sysvinit: nfs isn't mounted + #22084: sysvinit 2.74-4: SIGPWR missing on sparc + #21900: init, powerfail events, and shutdown.allow + #21702: init 0 does not work as expected... + #21728: sysvinit: Typo in `init.c' + #22363: sysvinit: discrepance btw. manpage and /sbin/init + #22579: power-off on halt + + -- Miquel van Smoorenburg Tue, 19 May 1998 11:02:29 +0200 + +sysvinit (2.74-4) frozen unstable; urgency=medium + + * Add -o option to last to process libc5 utmp files. + * Buffer overflow fixed in init.c (not very serious; only exploitable + by root). Thanks to Chris Evans + * Fixes: + #20147: filesystems not unmounted on reboot + #20702: sysvinit: example inittab is broken + #20957: errors mounting remote filesystems + #20063: fsck is _always_ called with -y option + + -- Miquel van Smoorenburg Wed, 15 Apr 1998 17:04:33 +0200 + +sysvinit (2.74-3) frozen unstable; urgency=high + + * Install hwclock.sh (was missing!) + + -- Miquel van Smoorenburg Thu, 19 Mar 1998 20:15:06 +0100 + +sysvinit (2.74-2) frozen unstable; urgency=high + + * Fix problem with removing kbd startup file + * Fixes bugs; + #19711: sysvinit: postinst uses /tmp/*.$$ + #14785: sysvinit: non executable scripts from examples + #17004: suggestion for raidtools + + -- Miquel van Smoorenburg Mon, 16 Mar 1998 12:56:10 +0100 + +sysvinit (2.74-1) unstable; urgency=low + + * Should compile with glibc 1.99 :) + * Now confirms to policy manual 2.4.0.0 + * Change behaviour of reboot(1) and halt(1) so that the default when + the runlevel can't be determined is to call shutdown. + * Updated README and skeleton + * Depends on new dpkg for the new update-rc.d + * Added re-exec patch from Al Viro (21 Feb 1998): + 'U' flag added to telinit. It forces init to re-exec itself + (passing its state through exec, certainly). + May be useful for smoother (heh) upgrades. + 24 Feb 1998, AV: + did_boot made global and added to state - thanks, Miquel. + Yet another file descriptors leak - close state pipe if + re_exec fails. + * Now no longer contains mdutils.sh and conflicts with older mdutils + * /etc/rc.S/*.sh scripts that use set -e or exit no longer stop + the whole boot process. + * Fixes: + #16082: sysvinit: filesystems do not get unmounted properly on shutdown + #16977: sysvinit: libc6 twice into Pre-Depends + #17012: sysvinit: minor typo in install + #17084: /etc/rcS does not use a start arg + #17276: sysvinit: SIGUSR1 causes init to eat CPU + #18541: sysvinit: ^C aborts entire rcS script + + -- Miquel van Smoorenburg Thu, 12 Mar 1998 17:42:46 +0100 + +sysvinit (2.73-2) unstable; urgency=low + + * Change _NSIG to NSIG for 2.1.x kernel includes. + * Hopefully fixes bug 16082, but we'll see.. + * Fixes bugs: + #16622 sysvinit: should not depend on kbd + #16807: /etc/init.d/mdutils.sh is started at bootup _and_ halt/reboot. + + -- Miquel van Smoorenburg Thu, 8 Jan 1998 16:01:02 +0100 + +sysvinit (2.73-1) unstable; urgency=low + + * Use siginterrupt, now that system calls are restarted by default. + Main symptom was that the sulogin timeout didn't work but there + might have been more hidden problems. + * Kill process immidiately if turned off in inittab + * Fixed sulogin check on tty arg. + * Use strerror() instead of sys_errlist + * Chop up the reboot and halt scripts into seperate scripts. I had to + take some liberties so they are called with the argument "stop" even + though the scripts are Sxx scripts .. (start scripts in runlevel 0&6 + seem non-intuitive anyway) + * wall now supports a '-n' option to suppress [most of] the banner. + Debian doesn't use sysvinit's wall, but apparently Redhat does. + * Add '-F' (forcefsck) option to shutdown + * Depends on kbd_0.95-2 (or higher) package for /etc/rcS.d stuff. + * Close and reopen /dev/initctl on SIGUSR1 (mainly for a /dev in ram) + * Add FSCKFIX option to /etc/default/rcS + * Wrote rcS.5 manpage describing /etc/default/rcS + * Fixes bugs: + #13435: Could shutdown provide a way to force fsck? + #14108: sysvinit: sulogin's timeout does not work anymore + #14179: sysvinit: /etc/init.d/(halt|reboot) need to call mdstop + #14357: sysvinit: typo errors into script shells + #15010: shutdown is too fast + #15405: sysvinit: changelog uncompressed + #15751: "sulogin -t " does not time out + #15758: Outdated reference in README + + -- Miquel van Smoorenburg Sat, 3 Jan 1998 16:32:39 +0100 + +sysvinit (2.72-3) unstable; urgency=low + + * Remove perl check from preinst + * Add extra fork() in dowall.c to avoid hanging in rare cases + * Conflict with file-rc (<= 0.4.1) + * The 2.72 series fix the following bugs: + #9819: sysvinit: Typo in `pidof` manual + #9820: sysvinit: Incorrect filenames in `shutdown` manual + #9821: sysvinit: `init` manual gives incorrect information + #9822: sysvinit: `inittab` manual + #10045: sysvinit: error message "no more processes..." + #10276: sysvinit has uncompressed manpages. + #11728: libc6 + #11879: sysvinit: file in /tmp security hole + #12172: Sysvinit: Contains powerd manpage but not powerd + #12465: Trivial typos in killall5 man page + #12631: sysvinit: unchecked prompting in postinst + #13290: clock is now hwclock + #13300: patch to init.d/boot for compressed keymaps + #13344: sysvinit: command 'clock' not found + #13789: sysvinit: /etc/init.d/boot calls "clock", should call "hwclock" + #13830: sysvinit: Upgrading to new sysvinit left system unusable + #13838: sysvinit: gratuitous use of perl + + -- Miquel van Smoorenburg Wed, 22 Oct 1997 14:44:00 +0200 + +sysvinit (2.72-2) unstable; urgency=high + + * Don't use perl in postinst. Use more flexible regexp to match the + sysinit line. + * Remove /etc/default/boot from package + * Fix settime.sh for hwclock + + -- Miquel van Smoorenburg Tue, 14 Oct 1997 12:40:23 +0200 + +sysvinit (2.72) unstable; urgency=low + + * Applied manual page patches by Bill Hawes . Thanks Bill! + * Applied patches to the sample Slackware scripts by + "Jonathan I. Kamens" + * Fix halt and reboot runlevels 0 & 6 check. + * Only say "no more processes left in runlevel x" once + * Fix race condition with SIGCHLD in spawn() + (thanks to Alon Ziv ) + * Compress all manpages (missed 2) + * Compiled for libc6 + * Split up /etc/init.d/boot into seperate files in /etc/rcS.d + * Remove powerd.8 from debian package + * Fix /etc/init.d/settime.sh to look for hwclock first + * Added poweroff patch by Roderich Schupp + + -- Miquel van Smoorenburg Sun, 12 Oct 1997 17:20:17 +0200 + +sysvinit (2.71-2) frozen unstable; urgency=low + + * Print 2.71 instead of 2.70 on startup :) + * Fix /etc/init.d/skeleton for new console messages standard. + + -- Miquel van Smoorenburg Mon, 5 May 1997 12:45:25 +0200 + +sysvinit (2.71-1) frozen unstable; urgency=high + + * Added code for updwtmp() in utmp.c for glibc (2.0.3) + * Fixed all programs to use functions from utmp.c and getutent() + * Do not try to clean up utmp in init itself (Bug#9022) + * Removed sync() from main loop. + * Fix bug #8739 (/fastboot) + * Hopefully fixes bug #8657 (shutdown signal handling) + * Mount /proc before modules are loaded + * Check on both /etc/init.d/modules and modutils (Bug#9058, #8398) + * Fix PATH order (Bug#8087) + * Fix console messages (Bug#8899) + + -- Miquel van Smoorenburg Sat, 26 Apr 1997 19:57:27 +0200 + +sysvinit (2.70-1) unstable; urgency=low + + * small fix for postinst (Bug#5866) + * Respawn fix + * Removed StUdLy CaPs from source code + * Moved files in source archive around + * Moved mdadd in "boot" script to get called after module loading + * Fixes for glibc (utmp handling, signal handling). + * Fixed '-d' option to last (now also works without '-a'). + * Added extra checking in last.c to prevent showing dead entries + + -- Miquel van Smoorenburg Fri, 7 Feb 1997 15:31:30 +0100 + +sysvinit (2.69-1) frozen unstable; urgency=medium + + * Fixed bug that can throw X in a loop (or any other app that reads from + /dev/tty0) + * Moved inittab to /usr/doc/sysvinit/examples so that it is no longer + a config file. + + -- Miquel van Smoorenburg Sun, 1 Dec 1996 15:32:24 +0100 + +sysvinit (2.68-1) frozen unstable; urgency=high + + * Added dummy fsck.nfs [temporary] (Bug#5492) + * Changing /etc/motd optional (Bug#5493) + * Typo in /etc/init.d/urandom fixed (Bug#5556) + + -- Miquel van Smoorenburg Wed, 27 Nov 1996 17:30:36 +0100 + +sysvinit (2.67-1) frozen unstable; urgency=high + + * Fixes problem with /dev/console being controlling terminal of some + daemons + * Some fixes in debian bootup script "boot" + * Puts copyright file in the right place + * Move random-seed stuff to its own file + * Fix skeleton file (add set -e) + * Change preinst/postinst scripts to save all variables from "boot" file + * moved /etc/init.d/network to /usr/doc/examples/sysvinit + * Changed "rc" script slightly (potential recipy for disaster..) + * Various other fixes to close all outstanding bug reports. + + -- Miquel van Smoorenburg Fri, 15 Nov 1996 12:23:33 +0100 + +sysvinit (2.66-1) unstable; urgency=medium + + * Skipped 2.65. A development 2.65 got out by accident and is apparently + being used.. + * New source format + * Also compiles and runs with GNU libc (and on the Alpha) + * Fixed dowall.c not to exit when getpwuid() fails and uid == 0. + * Fixed init panic'ing on empty lines in /etc/inittab + * Changed default PATH to include /usr/local/sbin + * Set /dev/console as controlling terminal for sysinit,bootwait,wait,powerwait + This allows using ^C to interrupt some parts of eg the boot process. + * Remove old symlink in /var/log/initlvl; let init check both + /var/log and /etc itself. + + -- Miquel van Smoorenburg Tue, 29 Oct 1996 13:46:54 +0100 + --- sysvinit-2.86.ds1.orig/debian/deps-mount +++ sysvinit-2.86.ds1/debian/deps-mount @@ -0,0 +1,14 @@ +# +# deps-mount +# +# Figure out which package we need to depend on in order to have +# the right mount program +# + +DEB_BUILD_GNU_TYPE="$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)" + +case "$DEB_BUILD_GNU_TYPE" in + *-linux|*-linux-gnu) + echo 'mount:Depends=mount (>= 2.11x-1)' + ;; +esac --- sysvinit-2.86.ds1.orig/debian/deps-glibc +++ sysvinit-2.86.ds1/debian/deps-glibc @@ -0,0 +1,14 @@ +# +# deps-glibc +# +# Figure out on which glibc version we need to depend on +# + +DEB_BUILD_GNU_SYSTEM="$(dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)" + +case "$DEB_BUILD_GNU_SYSTEM" in + gnu) + echo 'glibc:Depends=libc0.3 (>= 2.3.2.ds1-12)' + ;; +esac + --- sysvinit-2.86.ds1.orig/debian/readlink.c +++ sysvinit-2.86.ds1/debian/readlink.c @@ -0,0 +1,460 @@ +/* + * readlink Implementation of the readlink program that has a + * proper canonicalize function. + * + * The canonicalized path is printed if the entire path + * exists, but _also_ if the last path element is missing + * and the path up till there is a directory. + * + * If you specify -f or --canonicalize twice (aka + * canonicalize-me-harder) then the "most canonical" path + * is printed. Even if a part of it doesn't exist, though + * the exit status will be non-zero in that case. + * + * realpath If argv[0] is (^|/)realpath$, this program will behave + * as the realpath utility (-s not implemented). + * Note that 'readlink -ff' and 'realpath' are equivalent. + * + * Author: Miquel van Smoorenburg. + * + * Version: @(#)readlink 1.02 21-Mar-2004 miquels@cistron.nl + * + * This file is part of the sysvinit suite, + * Copyright 2004 Miquel van Smoorenburg. + * + * License: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * The realpath_sz() function in this file may also be + * redistributed under the terms of the LGPL: + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct option readlink_options[] = { + { "canonicalize", 0, NULL, 'f' }, + { "no-newline", 0, NULL, 'n' }, + { "quiet", 0, NULL, 'q' }, + { "silent", 0, NULL, 's' }, + { "help", 0, NULL, 'h' }, + { "verbose", 0, NULL, 'v' }, + { "version", 0, NULL, 'V' }, + { NULL, 0, NULL, 0 }, +}; + +struct option realpath_options [] = { + { "no-newline", 0, NULL, 'n' }, + { "help", 0, NULL, 'h' }, + { "verbose", 0, NULL, 'v' }, + { "version", 0, NULL, 'V' }, + { NULL, 0, NULL, 0 }, +}; + +static int system_path_max(char *name) +{ + int path_max; +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + if ((path_max = pathconf (name, _PC_PATH_MAX)) <= 0) + path_max = 1024; +#endif + return path_max; +} + +/* + * Error. Try to build the path till here into resolved, + * return -1 if that works, -2 if failed (that means that + * the contents of "resolved" make no sense whatsoever). + */ +static int path_err(char *resolved, unsigned int reslen, char *restpath) +{ + if (strlen(resolved) + strlen(restpath) + 1 >= reslen) { + errno = ENAMETOOLONG; + return -2; + } + strcat(resolved, "/"); + strcat(resolved, restpath); + return -1; +} + +/* + * Ye olde realpath() functionne. + * + * It takes an extra size argument for the resolved argument. + * + * Exit status: 0 path resolved + * -1 path not fully resolved (part not accessible) + * but canonicalized as far as possible. + * -2 error, "resolved" is invalid. + * + * If exit status < 0 errno is set. + */ +static int realpath_sz(char *path, char *resolved, unsigned int reslen) +{ + struct stat st; + char *p, *s; + char *buf, *buf2; + int c, n; + int exists = 1; + int link_max = _POSIX_LINK_MAX; + int links = 0; + int st_mode; + + /* + * Some basic checks and allocations. + */ + if (strlen(path) + 2 >= reslen) { + errno = ENAMETOOLONG; + return -2; + } + if ((buf = alloca(reslen)) == NULL) + return -2; + if ((buf2 = alloca(reslen)) == NULL) + return -2; + + /* + * Start with the current working directory + * if the path is relative. + */ + if (*path != '/') { + if (getcwd(resolved, reslen - 1) == NULL) { + if (errno == ERANGE) + errno = ENAMETOOLONG; + return -2; + } + strcpy(buf2, "/"); + strcat(buf2, path); + path = buf2; + } else { + strcpy(resolved, "/"); + } + + st.st_mode = S_IFDIR; + + while (1) { + + /* + * Skip multiple preceding slashes. + */ + while (*path == '/' && path[1] == '/') path++; + + /* + * At this point, "resolved" contains the path up + * till here without a trailing slash, and "path" + * contains the rest of the path starting with a /. + * + * One exception: if path is empty, then resolved + * can contain a single trailing slash (happens if + * path was just "/" in the previous round) + */ + st_mode = st.st_mode; + st.st_mode = S_IFREG; + if (exists > 0 && lstat(resolved, &st) < 0) { + if (errno != ENOENT && errno != ENOTDIR && + errno != EACCES) + return path_err(resolved, reslen, path); + exists--; + if (errno != ENOENT) exists--; + } + + /* + * Remove trailing slash if this is a directory. + */ + if ((s = strrchr(resolved, '/')) != NULL && s[1] == 0 && + s > resolved && S_ISDIR(st.st_mode)) + *s = 0; + + if (exists > 0 && S_ISLNK(st.st_mode)) { + /* + * It's a link. Prepend the rest of the + * remaining path with the contents of + * the link, remove the last element + * from resolved, and loop. + */ + if (++links > link_max) { + errno = ELOOP; + return path_err(resolved, reslen, path); + } + + if ((n = readlink(resolved, buf, reslen - 1)) < 0) + return path_err(resolved, reslen, path); + buf[n] = 0; + + if (buf[0] == '/') + p = resolved + 1; + else { + p = strrchr(resolved, '/'); + if (p == resolved) p++; + } + c = *p; + *p = 0; + if (strlen(resolved) + strlen(buf) + + strlen(path) + 3 >= reslen) { + *p = c; + return path_err(resolved, reslen, path); + } + if (*path) + strcat(buf, path); + buf2[0] = 0; + if (buf[0] != '/') strcat(buf2, "/"); + strcat(buf2, buf); + path = buf2; + + continue; + } + + /* + * Are we done? + */ + if (*path == 0) + break; + + /* + * repeating /./ sequences can be skipped. + */ + while (path[0] == '/' && path[1] == '.' && path[2] == '/') { + path += 2; + while (*path == '/' && path[1] == '/') path++; + } + + /* + * Is it a trailing / or /. or /./ ? + */ + if (exists > 0 && (path[1] == 0 || + (path[1] == '.' && (path[2] == 0 || path[2] == '/')))) { + + if (S_ISDIR(st.st_mode)) { + /* + * Skip . or ./ + */ + path++; + if (*path == '.') path++; + continue; + } + + /* + * Yup, ".", but that doesn't work if the + * parent path isn't a directory. + */ + errno = ENOTDIR; + exists = -1; + } + + /* + * Is it ../ ? + */ + if (exists > 0 && path[1] == '.' && path[2] == '.' && + (path[3] == 0 || path[3] == '/')) { + + if (S_ISDIR(st.st_mode)) { + /* + * Back up one element. + */ + p = strrchr(resolved, '/'); + if (p == resolved) p++; + *p = 0; + path += 3; + continue; + } + + /* + * Yup, "..", but that doesn't work if the + * parent path isn't a directory. + */ + errno = ENOTDIR; + exists = -1; + } + + /* + * Okay add this element to the resolved path. + */ + for (p = path + 1; *p && *p != '/'; p++) + ; + if (strlen(resolved) + (p - path) + 2 >= reslen) { + errno = ENAMETOOLONG; + return -2; + } + c = *p; + *p = 0; + if (resolved[0] == '/' && resolved[1] == 0) path++; + strcat(resolved, path); + *p = c; + path = p; + } + + return (exists > 0 || (exists == 0 && S_ISDIR(st_mode))) ? 0 : -1; +} + +void usage(char *progname) +{ + fprintf(stderr, "Usage: %s: [OPTION]... FILE\n", progname); + exit(1); +} + +void version(char *progname) +{ + printf("%s version 1.0 (sysvinit 2.85)\n", progname); + exit(1); +} + +char *mystrerror(int e) +{ + if (e == EINVAL) + return "Not a symbolic link"; + else + return strerror(e); +} + +int cmd_readlink(int argc, char **argv, char *progname) +{ + char *buf; + char *path; + int c, l, e; + int opt_canon = 0; + int opt_nonl = 0; + int opt_verbose = 0; + unsigned int path_max; + + while ((c = getopt_long(argc, argv, "fnqsv", readlink_options, NULL)) != EOF) switch(c) { + case 'f': + opt_canon++; + break; + case 'n': + opt_nonl++; + break; + case 'q': + case 's': + opt_verbose = 0; + break; + case 'v': + opt_verbose = 1; + break; + case 'V': + version(progname); + break; + default: + usage(progname); + break; + } + + if (optind != argc - 1) + usage(progname); + path = argv[optind]; + + /* + * Rules on printing stdout, stderr and exit status: + * + * simple readlink: succes: print value on stdout, exit 0 + * fail: print error on stderr, exit 1 + * + * canonicalize: succes: print path on stdout, exit 0 + * fail: print path on stdout if -ff + * print error on stderr if verbose + * exit 1 if path was still canonicalized + * exit 254 if not completely canon'ed + */ + + l = opt_canon ? -2 : -1; + + path_max = system_path_max(path); + if ((buf = alloca(path_max)) != NULL) { + if (opt_canon) { + l = realpath_sz(path, buf, path_max); + } else { + l = readlink(path, buf, path_max - 1); + if (l >= 0) + buf[l] = 0; + else + l = -2; + } + } + + e = errno; + + if (l >= 0 || opt_canon > 1) + printf("%s%s", (l == -2) ? path : buf, opt_nonl ? "" : "\n"); + + if (l < 0 && opt_verbose) + fprintf(stderr, "%s: %s: %s\n", progname, + (l == -2) ? path : buf, mystrerror(e)); + + if (l < 0) return (l == -2) ? 254 : 1; + return 0; +} + +int cmd_realpath(int argc, char **argv, char *progname) +{ + char *buf; + char *path; + int c, l, e; + int opt_nonl = 0; + int opt_verbose = 0; + int path_max; + + while ((c = getopt_long(argc, argv, "nv", realpath_options, NULL)) != EOF) switch(c) { + case 'n': + opt_nonl++; + break; + case 'v': + opt_verbose = 1; + break; + case 'V': + version(progname); + break; + default: + usage(progname); + break; + } + + if (optind != argc - 1) + usage(progname); + path = argv[optind]; + + path_max = system_path_max(path); + if ((buf = alloca(path_max)) != NULL) + l = realpath_sz(path, buf, path_max); + else + l = -2; + + e = errno; + + printf("%s%s", (l == -2) ? path : buf, opt_nonl ? "" : "\n"); + + if (l < 0 && opt_verbose) + fprintf(stderr, "%s: %s: %s\n", progname, + (l == -2) ? path : buf, mystrerror(e)); + + if (l < 0) return (l == -2) ? 254 : 1; + return 0; +} + +int main(int argc, char **argv) +{ + char *p; + + if ((p = strrchr(argv[0], '/')) != NULL) + p++; + else + p = argv[0]; + + if (strcmp(p, "realpath") == 0) + return cmd_realpath(argc, argv, p); + + return cmd_readlink(argc, argv, "readlink"); +} + --- sysvinit-2.86.ds1.orig/debian/NEWS +++ sysvinit-2.86.ds1/debian/NEWS @@ -0,0 +1,12 @@ +sysvinit (2.86.ds1-10) unstable; urgency=low + + In version 2.86.ds1-10 of the initscripts package the shell function + library /etc/init.d/bootclean.sh has been replaced by a new script + /etc/init.d/bootclean. If you made changes to the former in order + to customize the way files are cleaned at boot time then you will + have to port your changes to the new script. /etc/init.d/bootclean + continues to respect the TMPTIME variable and, in particular, does + not do any cleaning if TMPTIME is set to "infinite". See rcS(5). + + -- Thomas Hood Sun, 15 Jan 2006 13:38:42 +0100 + --- sysvinit-2.86.ds1.orig/debian/fscklog.sh +++ sysvinit-2.86.ds1/debian/fscklog.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# fscklog.sh See if we need to rotate the fsck logs +# + +MAXSIZE=51200 +NUMFILES=5 +export BOOTLOGFILE=/var/log/fsck/boot.log +export ROOTLOGFILE=/var/log/fsck/root.log + +if [ -f "$BOOTLOGFILE" ] && [ "$(stat -c %s $BOOTLOGFILE)" -gt "$MAXSIZE" ] +then + savelog -g adm -m 640 -u root -c $NUMFILES $BOOTLOGFILE +fi + +if [ -f "$ROOTLOGFILE" ] && [ "$(stat -c %s $ROOTLOGFILE)" -gt "$MAXSIZE" ] +then + savelog -g adm -m 640 -u root -c $NUMFILES $ROOTLOGFILE +fi --- sysvinit-2.86.ds1.orig/debian/copyright +++ sysvinit-2.86.ds1/debian/copyright @@ -0,0 +1,41 @@ +This is the Debian GNU/Linux prepackaged version of System V Init. + +Init was written by Miquel van Smoorenburg . + +This package was first put together by Bruce Perens +from pre-distribution sources. Ian Murdock +integrated it into the base system maintained it until the end of 1995. +Miquel van Smoorenburg implemented Debian support. +In version 2.85 the package was split into three (sysvinit, sysv-rc, +and initscripts) in order to make room for alternative rc mechanisms. + +The upstream source is available at: + +Primary-Site: ftp.cistron.nl /pub/people/miquels/software + 92K sysvinit-2.86.tar.gz +Alternate-Site: sunsite.unc.edu /pub/Linux/system/daemons/init + 92K sysvinit-2.86.tar.gz + +The sysvinit package in Debian is maintained as an alioth project. +The project page is http://alioth.debian.org/projects/pkg-sysvinit/. + +Copyright 1997-2005 Miquel van Smoorenburg and +the members pkg-sysvinit project. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- sysvinit-2.86.ds1.orig/debian/NOTES +++ sysvinit-2.86.ds1/debian/NOTES @@ -0,0 +1,147 @@ + Maintainer notes for sysvinit + +News +---- +Last updated 10 February 2006 + +Sourcing .sh scripts +-------------------- +If .sh scripts are sourced then we need to conflict with versions of +packages containing initscripts that exit: + + script source package bug report fixed in version + ------------------ -------------- ---------- ---------------- + S01glibc.sh glibc #340147 2.3.5-10 + S05keymap.sh console-common #340689 0.7.55 + S48console-screen.sh console-tools -- 1:0.2.3dbs-59 + S22hwclockfirst.sh util-linux #343447 2.12r-3 + S50hwclock.sh util-linux #343447 2.12r-3 + +Packages still containing .sh initscripts that exit: + + script source package bug report + ------------------ -------------- ---------- + S05initrd-tools.sh initrd-tools #340688 + S30procps.sh procps #343620 + +There may be other scripts. An audit should be performed. + +Stuff to implement +------------------ +* Do not allow system to continue booting if both fsck and sulogin fail (#337444)? +* Make sulogin try /bin/sh and /bin/sash too (#40144, #43317)? +* Port bootlogd to use posix_openpt(3), since BSD PTs are now deprecated and + /dev/pts _is_ now available at the time that bootlogd starts (...in Debian)? + +Stuff to do after etch +---------------------- +* mountnfs.sh: Don't start portmap +* bootclean: Use "-delete" and "-exec ... {} +" features of find for deleting (#316468) + +Ubuntu changes to backport +-------------------------- +(none known ATM) + +Stuff to send upstream +---------------------- +startpar patches +debian/patches/fix-minor-warnings should be applied upstream. +So should a lot of the other patches. + +src/Makefile should not set CC. + +set -e +------ +Note that many scripts do not use "set -e". This is deliberate. +Instead, return statuses are checked. + +PATH +---- +* Current policy: + + Leave unset if absolutely no pathless commands are run; otherwise... + + set to "/sbin:/bin" in /etc/init.d/rc and in scripts that run prior + to mountnfs.sh; otherwise... + + set to "/usr/sbin:/usr/bin:/sbin:/bin". + + Add "/lib/init" to beginning of PATH if readlink command or domount + function used. This will disappear once coreutils 5.94 makes it + into testing, and we Depend on that. +* Question: Should we include /usr/local/sbin and /usr/local/bin too? + I don't see this question addressed in Policy. Ref: #227540 + +Don't use bash +-------------- +In general the scripts should be /bin/sh scripts. + +umountfs in particular should not specify #!/bin/bash, because bash +loads /usr/lib/libldap.so when ldap authentication is enabled; +umount /usr/ would fail. (Bug #159771) + +Rotating fsck logs? +------------------- +debian/fscklog.sh is a proposed script for rotating fsck logs. +Currently, we _overwrite_ the fsck log files on every boot so there +is no need to rotate them. I am not inclined to implement rotation +of fsck logs. + +Dependencies +------------ +To go away: +* sysvinit Pre-Depends on initscripts, sysv-rc | file-rc so that the + conffiles in the old monolithic sysvinit package are taken over by + the initscripts package. (Only a Pre-Depends is strong enough to + ensure that the conffiles are taken over without an orphanic hiatus.) + Strictly speaking we can drop this dependency now since everyone is + either installing anew or else has upgraded to sarge; and Debian does + not support skip upgrades. However, I don't see any harm in keeping + this dependency around until after etch releases. But then it should + go away. +* initscripts Depends on mount >= 2.11x-1 because that's when swapon's + "-e" option was added. Sarge satisfies this requirement so this + dependency could be dropped. We can drop it after etch releases; + then both stable and oldstable will satisfy the requirement. +* initscripts needs to Depend on debianutils >= 2.12.0 until etch has + been released so that which can be assumed to be in /bin (rather than + in /usr/bin, as it was before, including in 2.8.4 in sarge) +* initscripts Conflicts with and Replaces mdutils which was last seen in + potato. Can disappear after etch. +* initscripts Conflicts with sysvinit (<< 2.86.ds1-12) because earlier + versions of bootlogd didn't have the -c option which the bootlogd + initscripts now uses + +Questionable: +* initscripts Replaces various libc packages for reasons described here: + http://lists.debian.org/debian-hurd/2004/06/msg00048.html. + Anyone know how long this dependency needs to be carried? +* sysv-rc (current) Conflicts with and Replaces file-rc. file-rc (0.8.7) + Replaces: sysv-rc but does not Conflict with it. I am not sure that + sysv-rc needs to Replace: file-rc. Isn't Conflicting sufficient? + And why doesn't file-rc Conflict with sysv-rc? Strange. + +Possible future: +* If the mtab initscript is ever changed so that it updates the mtab file + without rerunning mountdevsubfs.sh then initscripts should be made to + Conflict with udev << 0.080-1. (The latter versions of udev put the + udev initscript at S04, _after_ S04mountdevsubfs.sh, and the script + unmounts /dev/pts and /dev/shm.) + + +Speed and compatibility +----------------------- +People running Debian on low-memory systems say: +* Use built-ins +* Avoid fork-and-exec, pipelines, $() +* Reduce the number of commands within pipelines +* Avoid unnecessary code +* Avoid commands that don't work the same way in BusyBox: + 'nice', 'find', 'mount', 'umount', 'init', 'halt', 'shutdown', + 'syslogd', 'klogd', 'hwclock', 'cron', 'anacron', 'crontab'. + +Regenerate /etc/default/rcS? +---------------------------- +The current /etc/default/rcS template just refers the admin to rcS(5). +This way we have only one set of docs to maintain, and we don't have +to worry about out-of-date comments in /etc/default/rcS. + +I wonder if we should strip comments out of existing /etc/default/rcS +files, leaving behind only the reference to rcS(5). + --- sysvinit-2.86.ds1.orig/debian/patches/10_doc_manuals.dpatch +++ sysvinit-2.86.ds1/debian/patches/10_doc_manuals.dpatch @@ -0,0 +1,382 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_doc_manuals.dpatch by the Debian ALSA psychos +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Misc patches to manual pages + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./man/bootlogd.8 /tmp/dpep-work.VkakEo/trunk/man/bootlogd.8 +--- ./man/bootlogd.8 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/bootlogd.8 2006-02-15 17:10:18.000000000 +0100 +@@ -11,7 +11,7 @@ + .SH DESCRIPTION + \fBBootlogd\fP runs in the background and copies all strings sent to the + \fI/dev/console\fP device to a logfile. If the logfile is not accessible, +-the messages will be buffered in-memory until it is. ++the messages will be kept in memory until it is. + .SH OPTIONS + .IP \fB\-d\fP + Do not fork and run in the background. +@@ -20,19 +20,21 @@ + \fIlogfile~\fP unless \fIlogfile~\fP already exists. + .IP \fB\-v\fP + Show version. +-.IP \fB\-l logfile\fP ++.IP "\fB\-l\fP \fIlogfile\fP" + Log to this logfile. The default is \fI/var/log/boot\fP. +-.IP \fB\-p pidfile\fP ++.IP "\fB\-p\fP \fIpidfile\fP" + Put process-id in this file. The default is no pidfile. + .SH BUGS +-Bootlogd works by redirecting the console output from the console +-device. It copies that output to the real console device and a +-logfile. There is no standard way to find out the real console device +-if you have a new-style \fI/dev/console\fP device (major 5, minor 1). +-\fBBootlogd\fP tries to parse the kernel command line, looking for +-console= lines and deducts the real console device from that. If that +-syntax is ever changed by the kernel, or a console-type is used +-bootlogd does not know about, bootlogd will not work. ++Bootlogd works by redirecting the console output from the console device. ++(Consequently \fBbootlogd\fP requires PTY support in the kernel configuration.) ++It copies that output to the real console device and to a log file. ++There is no standard way of ascertaining the real console device ++if you have a new-style \fI/dev/console\fP device (major 5, minor 1) ++so \fBbootlogd\fP parses the kernel command line looking for ++\fBconsole=...\fP lines and deduces the real console device from that. ++If that syntax is ever changed by the kernel, or a console type is used that ++\fBbootlogd\fP does not know about then \fBbootlogd\fP will not work. ++ + .SH AUTHOR + Miquel van Smoorenburg, miquels@cistron.nl + .SH "SEE ALSO" +diff -urNad --exclude=CVS --exclude=.svn ./man/halt.8 /tmp/dpep-work.VkakEo/trunk/man/halt.8 +--- ./man/halt.8 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/halt.8 2006-02-15 17:10:18.000000000 +0100 +@@ -36,7 +36,7 @@ + .SH DESCRIPTION + \fBHalt\fP notes that the system is being brought down in the file + \fI/var/log/wtmp\fP, and then either tells the kernel to halt, reboot or +-poweroff the system. ++power-off the system. + .PP + If \fBhalt\fP or \fBreboot\fP is called when the system is + \fInot\fP in runlevel \fB0\fP or \fB6\fP, in other words when it's running +@@ -61,9 +61,9 @@ + .IP \fB\-i\fP + Shut down all network interfaces just before halt or reboot. + .IP \fB\-h\fP +-Put all harddrives on the system in standby mode just before halt or poweroff. ++Put all hard drives on the system in stand-by mode just before halt or power-off. + .IP \fB\-p\fP +-When halting the system, do a poweroff. This is the default when halt is ++When halting the system, switch off the power. This is the default when halt is + called as \fBpoweroff\fP. + .\"}}} + .\"{{{ Diagnostics +@@ -80,14 +80,14 @@ + correctly) \fBshutdown\fP will be called, which might not be what you want. + Use the \fB-f\fP flag if you want to do a hard \fBhalt\fP or \fBreboot\fP. + .PP +-The \fB-h\fP flag puts all harddisks in standby mode just before halt +-or poweroff. Right now this is only implemented for IDE drives. A side +-effect of putting the drive in standby mode is that the write cache ++The \fB-h\fP flag puts all hard disks in standby mode just before halt ++or power-off. Right now this is only implemented for IDE drives. A side ++effect of putting the drive in stand-by mode is that the write cache + on the disk is flushed. This is important for IDE drives, since the +-kernel doesn't flush the write-cache itself before poweroff. ++kernel doesn't flush the write cache itself before power-off. + .PP + The \fBhalt\fP program uses /proc/ide/hd* to find all IDE disk devices, +-which means that /proc needs to be mounted when \fBhalt\fP or ++which means that \fI/proc\fP needs to be mounted when \fBhalt\fP or + \fBpoweroff\fP is called or the \fB-h\fP switch will do nothing. + .PP + .\"}}} +diff -urNad --exclude=CVS --exclude=.svn ./man/init.8 /tmp/dpep-work.VkakEo/trunk/man/init.8 +--- ./man/init.8 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/init.8 2006-02-15 17:10:18.000000000 +0100 +@@ -36,21 +36,34 @@ + only a selected group of processes to exist. The processes spawned by + \fBinit\fP for each of these runlevels are defined in the + \fB/etc/inittab\fP file. \fBInit\fP can be in one of eight runlevels: +-\fB0\(en6\fP and \fBS\fP or \fBs\fP. The runlevel is ++\fB0\(en6\fP and \fBS\fP (a.k.a. \fBs\fP). The runlevel is + changed by having a privileged user run \fBtelinit\fP, which sends + appropriate signals to \fBinit\fP, telling it which runlevel to change + to. + .PP +-Runlevels \fB0\fP, \fB1\fP, and \fB6\fP are reserved. Runlevel 0 is used to +-halt the system, runlevel 6 is used to reboot the system, and runlevel +-1 is used to get the system down into single user mode. Runlevel \fBS\fP +-is not really meant to be used directly, but more for the scripts that are +-executed when entering runlevel 1. For more information on this, ++Runlevels \fBS\fP, \fB0\fP, \fB1\fP, and \fB6\fP are reserved. ++Runlevel S is used to initialize the system on boot. ++When starting runlevel S (on boot) ++or runlevel 1 (switching from a multi-user runlevel) ++the system is entering ``single-user mode'', after which the ++current runlevel is S. ++Runlevel 0 is used to halt the system; ++runlevel 6 is used to reboot the system. ++.PP ++After booting through S the system automatically enters one of ++the multi-user runlevels 2 through 5, unless there was some ++problem that needs to be fixed by the administrator in ++single-user mode. ++Normally after entering single-user mode ++the administrator performs maintenance and then reboots the system. ++.PP ++For more information, + see the manpages for \fBshutdown\fP(8) and \fBinittab\fP(5). + .PP + Runlevels 7-9 are also valid, though not really documented. This is + because "traditional" Unix variants don't use them. +-In case you're curious, runlevels \fIS\fP and \fIs\fP are in fact the same. ++.PP ++Runlevels \fIS\fP and \fIs\fP are the same. + Internally they are aliases for the same runlevel. + .\"}}} + .PP +@@ -62,9 +75,10 @@ + entry (or no \fB/etc/inittab\fP at all), a runlevel must be + entered at the system console. + .PP +-Runlevel \fBS\fP or \fBs\fP bring the system to single user mode +-and do not require an \fB/etc/inittab\fP file. In single user mode, +-\fB/sbin/sulogin\fP is invoked on \fB/dev/console\fP. ++Runlevel \fBS\fP or \fBs\fP initialize the system ++and do not require an \fB/etc/inittab\fP file. ++.PP ++In single user mode, \fB/sbin/sulogin\fP is invoked on \fB/dev/console\fP. + .PP + When entering single user mode, \fBinit\fP initializes the consoles + \fBstty\fP settings to sane values. Clocal mode is set. Hardware +@@ -254,6 +268,14 @@ + for them. If the processes change their group, \fBinit\fP can't + kill them and you may end up with two processes reading from one + terminal line. ++.PP ++On a Debian system, entering runlevel 1 causes all processes ++to be killed except for kernel threads and the script that does ++the killing and other processes in its session. ++As a consequence of this, it isn't safe to return from runlevel 1 ++to a multi-user runlevel: daemons that were started in runlevel S ++and are needed for normal operation are no longer running. ++The system should be rebooted. + .\"}}} + .\"{{{ Diagnostics + .SH DIAGNOSTICS +diff -urNad --exclude=CVS --exclude=.svn ./man/initscript.5 /tmp/dpep-work.VkakEo/trunk/man/initscript.5 +--- ./man/initscript.5 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/initscript.5 2006-02-15 17:10:18.000000000 +0100 +@@ -29,9 +29,9 @@ + PATH=/bin:/sbin:/usr/bin:/usr/sbin + export PATH + +- # Increase the hard filedescriptor limit for all processes +- # to 8192. The soft limit is still 1024, but any unpriviliged +- # process can increase it's soft limit up to the hardlimit ++ # Increase the hard file descriptor limit for all processes ++ # to 8192. The soft limit is still 1024, but any unprivileged ++ # process can increase its soft limit up to the hard limit + # with "ulimit -Sn xxx" (needs a 2.2.13 or later Linux kernel). + ulimit -Hn 8192 + +diff -urNad --exclude=CVS --exclude=.svn ./man/inittab.5 /tmp/dpep-work.VkakEo/trunk/man/inittab.5 +--- ./man/inittab.5 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/inittab.5 2006-02-15 17:10:18.000000000 +0100 +@@ -128,7 +128,7 @@ + .\"}}} + .\"{{{ powerokwait + .IP \fBpowerokwait\fP +-This process will be executed as soon as \fBinit\fP is informormed that the ++This process will be executed as soon as \fBinit\fP is informed that the + power has been restored. + .\"}}} + .\"{{{ powerfailnow +diff -urNad --exclude=CVS --exclude=.svn ./man/last.1 /tmp/dpep-work.VkakEo/trunk/man/last.1 +--- ./man/last.1 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/last.1 2006-02-15 17:10:18.000000000 +0100 +@@ -51,6 +51,8 @@ + .\"}}} + .\"{{{ Options + .SH OPTIONS ++.IP "\fB\-f\fP \fIfile\fP" ++Tells \fBlast\fP to use a specific file instead of \fB/var/log/wtmp\fP. + .IP \fB\-\fP\fInum\fP + This is a count telling \fBlast\fP how many lines to show. + .IP "\fB\-n\fP \fInum\fP" +diff -urNad --exclude=CVS --exclude=.svn ./man/mesg.1 /tmp/dpep-work.VkakEo/trunk/man/mesg.1 +--- ./man/mesg.1 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/mesg.1 2006-02-15 17:10:18.000000000 +0100 +@@ -26,7 +26,9 @@ + .PP + If no option is given, \fBmesg\fP prints out the current access state of your + terminal. +-.PP NOTES ++.\"}}} ++.\"{{{ Notes ++.SH NOTES + \fBMesg\fP assumes that its standard input is connected to your + terminal. That also means that if you are logged in multiple times, + you can get/set the mesg status of other sessions by using redirection. +diff -urNad --exclude=CVS --exclude=.svn ./man/pidof.8 /tmp/dpep-work.VkakEo/trunk/man/pidof.8 +--- ./man/pidof.8 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/pidof.8 2006-02-15 17:12:34.000000000 +0100 +@@ -31,9 +31,16 @@ + Tells \fIpidof\fP to omit processes with that process id. The special + pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP + program, in other words the calling shell or shell script. ++.SH "EXIT STATUS" ++.TP ++.B 0 ++At least one program was found with the requested name. ++.TP ++.B 1 ++No program was found with the requested name. + .SH NOTES +-\fIpidof\fP is simply a (symbolic) link to the \fIkillall5\fP program, +-which should also be located in \fP/sbin\fP. ++\fIpidof\fP is actually the same program as \fIkillall5\fP; ++the program behaves according to the name under which it is called. + .PP + When \fIpidof\fP is invoked with a full pathname to the program it + should find the pid of, it is reasonably safe. Otherwise it is possible +diff -urNad --exclude=CVS --exclude=.svn ./man/shutdown.8 /tmp/dpep-work.VkakEo/trunk/man/shutdown.8 +--- ./man/shutdown.8 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/shutdown.8 2006-02-15 17:10:18.000000000 +0100 +@@ -54,7 +54,7 @@ + .\"}}} + .\"{{{ -h + .IP \fB\-h\fP +-Halt or poweroff after shutdown. ++Halt or power off after shutdown. + .\"}}} + .\"{{{ -H + .IP \fB\-H\fP +@@ -100,10 +100,11 @@ + Second, it can be in the format \fB+\fP\fIm\fP, in which \fIm\fP is the + number of minutes to wait. The word \fBnow\fP is an alias for \fB+0\fP. + .PP +-If shutdown is called with a delay, it creates the advisory file ++If shutdown is called with a delay, it will create the advisory file + .I /etc/nologin + which causes programs such as \fIlogin(1)\fP to not allow new user +-logins. Shutdown removes this file if it is stopped before it ++logins. This file is created five minutes before the shutdown sequence ++starts. Shutdown removes this file if it is stopped before it + can signal init (i.e. it is cancelled or something goes wrong). + It also removes it before calling init to change the runlevel. + .PP +@@ -117,13 +118,13 @@ + file \fI/forcefsck\fP which can be tested by the system when it comes + up again. The boot rc file can test if this file is present, and decide + to run \fBfsck\fP(1) with a special `force' flag so that even properly +-unmounted filesystems get checked. ++unmounted file systems get checked. + After that, the boot process should remove \fI/forcefsck\fP. + .PP + The \fB-n\fP flag causes \fBshutdown\fP not to call \fBinit\fP, + but to kill all running processes itself. + \fBshutdown\fP will then turn off quota, accounting, and swapping +-and unmount all filesystems. ++and unmount all file systems. + .\"}}} + .\"{{{ Files + .SH ACCESS CONTROL +diff -urNad --exclude=CVS --exclude=.svn ./man/sulogin.8 /tmp/dpep-work.VkakEo/trunk/man/sulogin.8 +--- ./man/sulogin.8 2005-12-02 17:22:58.000000000 +0100 ++++ /tmp/dpep-work.VkakEo/trunk/man/sulogin.8 2006-02-15 17:10:18.000000000 +0100 +@@ -1,61 +1,68 @@ +-.TH SULOGIN 8 "04 Nov 2003" "" "Linux System Administrator's Manual" ++.TH SULOGIN 8 "17 Jan 2006" "" "Linux System Administrator's Manual" + .SH NAME +-sulogin -- Single-user login ++sulogin \- Single-user login + .SH SYNOPSIS + .B sulogin +-.RB [ " -e " ] +-.RB [ " -p " ] +-.RB [ " -t timeout " ] +-.RB [ " tty-device " ] ++[ \fB\-e\fP ] ++[ \fB\-p\fP ] ++[ \fB\-t\fP \fISECONDS\fP ] ++[ \fITTY\fP ] + .SH DESCRIPTION + .I sulogin +-is invoked by \fBinit(8)\fP when the system goes into single user mode +-(this is done through an entry in \fIinittab(5)\fP). \fBInit\fP also +-tries to execute \fIsulogin\fP when it is passed the \fB-b\fP flag +-from the bootmonitor (eg, LILO). ++is invoked by \fBinit(8)\fP when the system goes into single user mode. ++(This is done through an entry in \fIinittab(5)\fP.) ++\fBInit\fP also ++tries to execute \fIsulogin\fP when ++the boot loader (e.g., \fBgrub\fP(8)) ++passes it the \fB\-b\fP option. + .PP + The user is prompted + .IP "" .5i + Give root password for system maintenance + .br +-(or type Control-D for normal startup): ++(or type Control\-D for normal startup): + .PP + \fIsulogin\fP will be connected to the current terminal, or to the + optional device that can be specified on the command line + (typically \fB/dev/console\fP). + .PP +-If the \fB-p\fP flag was set, the single-user shell will be invoked +-with a \fIdash\fP as the first character in \fIargv[0]\fP. That will +-cause most shells to behave as a login shell. The default is \fInot\fP +-to do this, so that the shell will \fInot\fP read \fB/etc/profile\fP ++If the \fB\-t\fP option is used then the program only waits ++the given number of seconds for user input. ++.PP ++If the \fB\-p\fP option is used then the single-user shell is invoked ++with a \fIdash\fP as the first character in \fIargv[0]\fP. ++This causes the shell process to behave as a login shell. ++The default is \fInot\fP to do this, ++so that the shell will \fInot\fP read \fB/etc/profile\fP + or \fB$HOME/.profile\fP at startup. + .PP +-After the user exits the single-user shell, or presses control-d at the +-prompt, the system will (continue to) boot to the default runlevel. ++After the user exits the single-user shell, ++or presses control\-D at the prompt, ++the system will (continue to) boot to the default runlevel. + .SH ENVIRONMENT VARIABLES + \fIsulogin\fP looks for the environment variable \fBSUSHELL\fP or + \fBsushell\fP to determine what shell to start. If the environment variable + is not set, it will try to execute root's shell from /etc/passwd. If that + fails it will fall back to \fB/bin/sh\fP. + .PP +-This is very valuable together with the \fB-b\fP flag to init. To boot ++This is very valuable together with the \fB\-b\fP option to init. To boot + the system into single user mode, with the root file system mounted read/write, +-using a special "failsafe" shell that is statically linked (this example ++using a special "fail safe" shell that is statically linked (this example + is valid for the LILO bootprompt) + .PP +-boot: linux -b rw sushell=/sbin/sash ++boot: linux \-b rw sushell=/sbin/sash + .SH FALLBACK METHODS + \fIsulogin\fP checks the root password using the standard method (getpwnam) + first. +-Then, if the \fB-e\fP option was specified, ++Then, if the \fB\-e\fP option was specified, + \fIsulogin\fP examines these files directly to find the root password: + .PP + /etc/passwd, + .br + /etc/shadow (if present) + .PP +-If they are damaged or non-existant, sulogin will start a root shell +-without asking for a password. Only use the \fB-e\fP option if you ++If they are damaged or nonexistent, sulogin will start a root shell ++without asking for a password. Only use the \fB\-e\fP option if you + are sure the console is physically protected against unauthorized access. + .SH AUTHOR + Miquel van Smoorenburg --- sysvinit-2.86.ds1.orig/debian/patches/61_init_msg.dpatch +++ sysvinit-2.86.ds1/debian/patches/61_init_msg.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 61_init_msg.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Improve error message if fork() fail. Patch found in Suse. + +@DPATCH@ +Index: sysvinit/src/init.c +=================================================================== +--- sysvinit/src/init.c (revisjon 62) ++++ sysvinit/src/init.c (arbeidskopi) +@@ -967,7 +967,8 @@ + dup(f); + } + if ((pid = fork()) < 0) { +- initlog(L_VB, "cannot fork"); ++ initlog(L_VB, "cannot fork: %s", ++ strerror(errno)); + exit(1); + } + if (pid > 0) { +@@ -997,7 +998,8 @@ + * this with a temporary process. + */ + if ((pid = fork()) < 0) { +- initlog(L_VB, "cannot fork"); ++ initlog(L_VB, "cannot fork: %s", ++ strerror(errno)); + exit(1); + } + if (pid == 0) { --- sysvinit-2.86.ds1.orig/debian/patches/00list +++ sysvinit-2.86.ds1/debian/patches/00list @@ -0,0 +1,33 @@ +10_doc_manuals +11_doc_mountpoint +# 12_doc_lastb patch is reported to be incorrect. +#12_doc_lastb +13_doc_telinit +14_doc_fsf_addr +15_doc_pidof +16_doc_runlevel +20_pidof +21_ifdown_kfreebsd +25_last_sanify +30_strip +31_build_warnings +40_selinux +41_selinux_console +45_pidof_symlink +50_bootlogd_exitcode +51_bootlogd_syncalot +52_bootlogd_createlogfile +53_bootlogd_ttyB +60_init_race +61_init_msg +62_init_freebsdterm +63_init_longer_procname +64_init_set_PATH +65_init_u_in_06 +70_wall_ttyname +71_wall_hostname +80_killall_sched +81_killall_avoid_init +90_shutdown_H +99_ubuntu_01_sulogin.dpatch +99_ubuntu_02_splash.dpatch --- sysvinit-2.86.ds1.orig/debian/patches/99_ubuntu_01_sulogin.dpatch +++ sysvinit-2.86.ds1/debian/patches/99_ubuntu_01_sulogin.dpatch @@ -0,0 +1,52 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 99_ubuntu_01_sulogin.dpatch by Scott James Remnant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Don't treat locked root passwords as garbled; and don't try and ask +## DP: for the password -- just spawn a shell. + +@DPATCH@ +diff -urNad sysvinit-2.86.ds1~/man/sulogin.8 sysvinit-2.86.ds1/man/sulogin.8 +--- sysvinit-2.86.ds1~/man/sulogin.8 2006-10-05 10:20:45.000000000 +0100 ++++ sysvinit-2.86.ds1/man/sulogin.8 2006-10-05 10:23:00.000000000 +0100 +@@ -22,6 +22,10 @@ + .br + (or type Control\-D for normal startup): + .PP ++If the root account is locked, as is the default on Ubuntu, no password ++prompt is displayed and \fIsulogin\fR behaves as if the correct password ++were entered. ++.PP + \fIsulogin\fP will be connected to the current terminal, or to the + optional device that can be specified on the command line + (typically \fB/dev/console\fP). +diff -urNad sysvinit-2.86.ds1~/src/sulogin.c sysvinit-2.86.ds1/src/sulogin.c +--- sysvinit-2.86.ds1~/src/sulogin.c 2006-10-05 10:20:46.000000000 +0100 ++++ sysvinit-2.86.ds1/src/sulogin.c 2006-10-05 10:20:47.000000000 +0100 +@@ -238,7 +238,11 @@ + fprintf(stderr, "%s: no entry for root\n", F_SHADOW); + strcpy(pwd.pw_passwd, ""); + } +- if (!valid(pwd.pw_passwd)) { ++ ++ /* disabled passwords are valid too */ ++ if ((pwd.pw_passwd[0] == '*') || ++ (pwd.pw_passwd[0] == '!') || ++ !valid(pwd.pw_passwd)) { + fprintf(stderr, "%s: root password garbled\n", F_SHADOW); + strcpy(pwd.pw_passwd, ""); } + return &pwd; +@@ -451,6 +455,13 @@ + sleep(2); + } + ++ /* ++ * If the root password is locked, fire up a shell ++ */ ++ if ((pwd->pw_passwd[0] == '*') || ++ (pwd->pw_passwd[0] == '!')) ++ sushell(pwd); ++ + /* + * Ask for the password. + */ --- sysvinit-2.86.ds1.orig/debian/patches/91_sulogin_lockedpw.dpatch +++ sysvinit-2.86.ds1/debian/patches/91_sulogin_lockedpw.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 91_sulogin_lockedpw.dpatch by Thom May +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure file systems can be fixed on machines with locked +## DP: root accounts too, by presenting a shell in these cases. +## DP: Patch from Ubuntu and Thom May. Fixes debian bug #326678. + +@DPATCH@ +Index: sysvinit/src/sulogin.c +=================================================================== +--- sysvinit/src/sulogin.c (revisjon 113) ++++ sysvinit/src/sulogin.c (arbeidskopi) +@@ -234,7 +234,11 @@ + fprintf(stderr, "%s: no entry for root\n", F_SHADOW); + strcpy(pwd.pw_passwd, ""); + } +- if (!valid(pwd.pw_passwd)) { ++ ++ /* disabled passwords are valid too */ ++ if (!(strcmp(pwd.pw_passwd, "*") == 0) || ++ !(strcmp(pwd.pw_passwd, "!") == 0) || ++ !valid(pwd.pw_passwd)) { + fprintf(stderr, "%s: root password garbled\n", F_SHADOW); + strcpy(pwd.pw_passwd, ""); } + return &pwd; +@@ -436,6 +440,14 @@ + fprintf(stderr, "sulogin: cannot open password database!\n"); + sleep(2); + } ++ /* ++ * If the root password is locked, fire up a shell ++ */ ++ if ((strcmp(pwd->pw_passwd, "*") == 0) || ++ (strcmp(pwd->pw_passwd, "!") == 0)) { ++ fprintf(stderr, "sulogin: root accound is locked, starting shell\n"); ++ sushell(pwd); ++ } + + /* + * Ask for the password. --- sysvinit-2.86.ds1.orig/debian/patches/90_shutdown_H.dpatch +++ sysvinit-2.86.ds1/debian/patches/90_shutdown_H.dpatch @@ -0,0 +1,39 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 90_shutdown_H.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure shutdown flags -H and -P are only given with -h flag, +## DP: and document this requirement in the manual page. Fixes bug +## DP: #331041. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./man/shutdown.8 /tmp/dpep-work.apEvIZ/trunk/man/shutdown.8 +--- ./man/shutdown.8 2006-02-01 14:32:46.000000000 +0100 ++++ /tmp/dpep-work.apEvIZ/trunk/man/shutdown.8 2006-02-01 14:36:39.000000000 +0100 +@@ -58,8 +58,8 @@ + .\"}}} + .\"{{{ -H + .IP \fB\-H\fP +-Halt action is to halt or drop into boot monitor on systems that +-support it. ++Modifier to the -h flag. Halt action is to halt or drop into boot ++monitor on systems that support it. Must be used with the -h flag. + .\"}}} + .\"{{{ -P + .IP \fB\-P\fP +diff -urNad --exclude=CVS --exclude=.svn ./src/shutdown.c /tmp/dpep-work.apEvIZ/trunk/src/shutdown.c +--- ./src/shutdown.c 2005-12-02 17:22:57.000000000 +0100 ++++ /tmp/dpep-work.apEvIZ/trunk/src/shutdown.c 2006-02-01 14:32:49.000000000 +0100 +@@ -521,6 +521,12 @@ + } + } + ++ if (NULL != halttype && down_level[0] != '0') { ++ fprintf(stderr, "shutdown: -H and -P flags can only be used along with -h flag.\n"); ++ usage(); ++ exit(1); ++ } ++ + /* Do we need to use the shutdown.allow file ? */ + if (useacl && (fp = fopen(SDALLOW, "r")) != NULL) { + --- sysvinit-2.86.ds1.orig/debian/patches/40_selinux.dpatch +++ sysvinit-2.86.ds1/debian/patches/40_selinux.dpatch @@ -0,0 +1,339 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 40_selinux.dpatch by Manoj Srivastava +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add support for SELinux. + +@DPATCH@ +Index: trunk/src/init.c +=================================================================== +--- trunk/src/init.c (revisjon 34) ++++ trunk/src/init.c (arbeidskopi) +@@ -80,6 +80,157 @@ + sigaction(sig, &sa, NULL); \ + } while(0) + ++ ++#ifdef WITH_SELINUX ++#include ++#include ++#include ++#include ++ ++/* Mount point for selinuxfs. */ ++#define SELINUXMNT "/selinux/" ++int enforcing = -1; /* SELinux enforcing mode */ ++ ++static int load_policy(int *enforce) ++{ ++ int fd=-1,ret=-1; ++ int rc=0, orig_enforce; ++ struct stat sb; ++ void *map; ++ char policy_file[PATH_MAX]; ++ int policy_version=0; ++ extern char *selinux_mnt; ++ FILE *cfg; ++ char buf[4096]; ++ int seconfig = -2; ++ ++ selinux_getenforcemode(&seconfig); ++ ++ mount("none", "/proc", "proc", 0, 0); ++ cfg = fopen("/proc/cmdline","r"); ++ if (cfg) { ++ char *tmp; ++ if (fgets(buf,4096,cfg) && (tmp = strstr(buf,"enforcing="))) { ++ if (tmp == buf || isspace(*(tmp-1))) { ++ enforcing=atoi(tmp+10); ++ } ++ } ++ fclose(cfg); ++ } ++#define MNT_DETACH 2 ++ umount2("/proc",MNT_DETACH); ++ ++ if (enforcing >=0) ++ *enforce = enforcing; ++ else if (seconfig == 1) ++ *enforce = 1; ++ ++ if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0) { ++ if (errno == ENODEV) { ++ printf("SELinux not supported by kernel: %s\n",strerror(errno)); ++ *enforce = 0; ++ } else { ++ printf("Failed to mount %s: %s\n",SELINUXMNT,strerror(errno)); ++ } ++ return ret; ++ } ++ ++ selinux_mnt = SELINUXMNT; /* set manually since we mounted it */ ++ ++ policy_version=security_policyvers(); ++ if (policy_version < 0) { ++ printf( "Can't get policy version: %s\n", strerror(errno)); ++ goto UMOUNT; ++ } ++ ++ orig_enforce = rc = security_getenforce(); ++ if (rc < 0) { ++ printf( "Can't get SELinux enforcement flag: %s\n", strerror(errno)); ++ goto UMOUNT; ++ } ++ if (enforcing >= 0) { ++ *enforce = enforcing; ++ } else if (seconfig == -1) { ++ *enforce = 0; ++ rc = security_disable(); ++ if (rc == 0) umount(SELINUXMNT); ++ if (rc < 0) { ++ rc = security_setenforce(0); ++ if (rc < 0) { ++ printf("Can't disable SELinux: %s\n", strerror(errno)); ++ goto UMOUNT; ++ } ++ } ++ ret = 0; ++ goto UMOUNT; ++ } else if (seconfig >= 0) { ++ *enforce = seconfig; ++ if (orig_enforce != *enforce) { ++ rc = security_setenforce(seconfig); ++ if (rc < 0) { ++ printf("Can't set SELinux enforcement flag: %s\n", strerror(errno)); ++ goto UMOUNT; ++ } ++ } ++ } ++ ++ snprintf(policy_file,sizeof(policy_file),"%s.%d",selinux_binary_policy_path(),policy_version); ++ fd = open(policy_file, O_RDONLY); ++ if (fd < 0) { ++ /* Check previous version to see if old policy is available ++ */ ++ snprintf(policy_file,sizeof(policy_file),"%s.%d",selinux_binary_policy_path(),policy_version-1); ++ fd = open(policy_file, O_RDONLY); ++ if (fd < 0) { ++ printf( "Can't open '%s.%d': %s\n", ++ selinux_binary_policy_path(),policy_version,strerror(errno)); ++ goto UMOUNT; ++ } ++ } ++ ++ if (fstat(fd, &sb) < 0) { ++ printf("Can't stat '%s': %s\n", ++ policy_file, strerror(errno)); ++ goto UMOUNT; ++ } ++ ++ map = mmap(NULL, sb.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ++ if (map == MAP_FAILED) { ++ printf( "Can't map '%s': %s\n", ++ policy_file, strerror(errno)); ++ goto UMOUNT; ++ } ++ ++ ++ /* Set booleans based on a booleans configuration file. */ ++ ret = sepol_genbools(map, sb.st_size, selinux_booleans_path()); ++ if (ret < 0) { ++ if (errno == ENOENT || errno == EINVAL) { ++ /* No booleans file or stale booleans in the file; non-fatal. */ ++ printf("Warning! Error while setting booleans: %s\n" ++ , strerror(errno)); ++ } else { ++ printf("Error while setting booleans: %s\n", ++ strerror(errno)); ++ goto UMOUNT; ++ } ++ } ++ printf("Loading security policy\n"); ++ ret=security_load_policy(map, sb.st_size); ++ if (ret < 0) { ++ printf("security_load_policy failed\n"); ++ } ++ ++ UMOUNT: ++ /*umount(SELINUXMNT); */ ++ if ( fd >= 0) { ++ close(fd); ++ } ++ return(ret); ++} ++#endif ++ ++ + /* Version information */ + char *Version = "@(#) init " VERSION " " DATE " miquels@cistron.nl"; + char *bootmsg = "version " VERSION " %s"; +@@ -2599,6 +2750,7 @@ + char *p; + int f; + int isinit; ++ int enforce = 0; + + /* Get my own name */ + if ((p = strrchr(argv[0], '/')) != NULL) +@@ -2662,6 +2814,21 @@ + maxproclen += strlen(argv[f]) + 1; + } + ++#ifdef WITH_SELINUX ++ if (getenv("SELINUX_INIT") == NULL) { ++ putenv("SELINUX_INIT=YES"); ++ if (load_policy(&enforce) == 0 ) { ++ execv(myname, argv); ++ } else { ++ if (enforce > 0) { ++ /* SELinux in enforcing mode but load_policy failed */ ++ /* At this point, we probably can't open /dev/console, so log() won't work */ ++ fprintf(stderr,"Enforcing mode requested but no policy loaded. Halting now.\n"); ++ exit(1); ++ } ++ } ++ } ++#endif + /* Start booting. */ + argv0 = argv[0]; + argv[1] = NULL; +Index: trunk/src/killall5.c +=================================================================== +--- trunk/src/killall5.c (revisjon 34) ++++ trunk/src/killall5.c (arbeidskopi) +@@ -165,8 +165,11 @@ + + /* + * Read the proc filesystem. ++ * since pidOf does not use process sid added a needSid flag to eliminate ++ * the need of this privs for SELinux ++ * + */ +-int readproc() ++int readproc(int needSid) + { + DIR *dir; + FILE *fp; +@@ -259,7 +262,17 @@ + free(p); + continue; + } +- ++ if (needSid) { ++ p->sid = getsid(pid); ++ if (p->sid < 0) { ++ p->sid = 0; ++ nsyslog(LOG_ERR, "can't read sid for pid %d\n", pid); ++ free(p); ++ continue; ++ } ++ } else { ++ p->sid = 0; ++ } + snprintf(path, sizeof(path), "/proc/%s/cmdline", d->d_name); + if ((fp = fopen(path, "r")) != NULL) { + +@@ -519,7 +532,7 @@ + argv += optind; + + /* Print out process-ID's one by one. */ +- readproc(); ++ readproc(0); + for(f = 0; f < argc; f++) { + if ((q = pidof(argv[f])) != NULL) { + spid = 0; +@@ -600,7 +613,7 @@ + sent_sigstop = 1; + + /* Read /proc filesystem */ +- if (readproc() < 0) { ++ if (readproc(1) < 0) { + kill(-1, SIGCONT); + exit(1); + } +Index: trunk/src/sulogin.c +=================================================================== +--- trunk/src/sulogin.c (revisjon 34) ++++ trunk/src/sulogin.c (arbeidskopi) +@@ -28,6 +28,10 @@ + # include + #endif + ++#ifdef WITH_SELINUX ++#include ++#include ++#endif + #define CHECK_DES 1 + #define CHECK_MD5 1 + +@@ -335,6 +339,16 @@ + signal(SIGINT, SIG_DFL); + signal(SIGTSTP, SIG_DFL); + signal(SIGQUIT, SIG_DFL); ++#ifdef WITH_SELINUX ++ if (is_selinux_enabled > 0) { ++ security_context_t* contextlist=NULL; ++ if (get_ordered_context_list("root", 0, &contextlist) > 0) { ++ if (setexeccon(contextlist[0]) != 0) ++ fprintf(stderr, "setexeccon faile\n"); ++ freeconary(contextlist); ++ } ++ } ++#endif + execl(sushell, shell, NULL); + perror(sushell); + +Index: trunk/src/Makefile +=================================================================== +--- trunk/src/Makefile (revisjon 34) ++++ trunk/src/Makefile (arbeidskopi) +@@ -49,6 +49,18 @@ + INSTALL = install -o $(BIN_OWNER) -g $(BIN_GROUP) + MANDIR = /usr/share/man + ++ifeq ($(WITH_SELINUX),yes) ++ SELINUX_DEF=-DWITH_SELINUX ++ INIT_SELIBS=-lsepol -lselinux ++ SULOGIN_SELIBS=-lselinux ++else ++ SELINUX_DEF= ++ INIT_SELIBS= ++ SULOGIN_SELIBS= ++endif ++ ++ ++ + # Additional libs for GNU libc. + ifneq ($(wildcard /usr/lib/libcrypt.a),) + LCRYPT = -lcrypt +@@ -57,7 +69,7 @@ + all: $(BIN) $(SBIN) $(USRBIN) + + init: init.o init_utmp.o +- $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o ++ $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o $(INIT_SELIBS) + + halt: halt.o ifdown.o hddown.o utmp.o reboot.h + $(CC) $(LDFLAGS) -o $@ halt.o ifdown.o hddown.o utmp.o +@@ -78,7 +90,7 @@ + $(CC) $(LDFLAGS) -o $@ runlevel.o + + sulogin: sulogin.o +- $(CC) $(LDFLAGS) $(STATIC) -o $@ sulogin.o $(LCRYPT) ++ $(CC) $(LDFLAGS) $(STATIC) $(SELINUX_DEF) -o $@ $^ $(LCRYPT) $(SULOGIN_SELIBS) + + wall: dowall.o wall.o + $(CC) $(LDFLAGS) -o $@ dowall.o wall.o +@@ -89,8 +101,11 @@ + bootlogd: bootlogd.o + $(CC) $(LDFLAGS) -o $@ bootlogd.o -lutil + ++sulogin.o: sulogin.c ++ $(CC) -c $(CFLAGS) $(SELINUX_DEF) sulogin.c ++ + init.o: init.c init.h set.h reboot.h initreq.h +- $(CC) -c $(CFLAGS) init.c ++ $(CC) -c $(CFLAGS) $(SELINUX_DEF) init.c + + utmp.o: utmp.c init.h + $(CC) -c $(CFLAGS) utmp.c --- sysvinit-2.86.ds1.orig/debian/patches/15_doc_pidof.dpatch +++ sysvinit-2.86.ds1/debian/patches/15_doc_pidof.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 15_doc_pidof.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix typo in pidof manual page. + +@DPATCH@ +Index: sysvinit/man/pidof.8 +=================================================================== +--- sysvinit/man/pidof.8 (revision 93) ++++ sysvinit/man/pidof.8 (working copy) +@@ -27,7 +27,7 @@ + .IP -x + Scripts too - this causes the program to also return process id's of + shells running the named scripts. +-.IP -o \fIomitpid\fP ++.IP "-o \fIomitpid\fP" + Tells \fIpidof\fP to omit processes with that process id. The special + pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP + program, in other words the calling shell or shell script. --- sysvinit-2.86.ds1.orig/debian/patches/62_init_freebsdterm.dpatch +++ sysvinit-2.86.ds1/debian/patches/62_init_freebsdterm.dpatch @@ -0,0 +1,25 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 62_init_freebsdterm.dpatch by Robert Millan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure TERM is set on FreeBSD. Closes debian bug #335023. + +@DPATCH@ +diff -ur sysvinit-2.86.ds1.old/src/init.c sysvinit-2.86.ds1/src/init.c +--- sysvinit-2.86.ds1.old/src/init.c 2004-07-30 14:16:20.000000000 +0200 ++++ sysvinit-2.86.ds1/src/init.c 2005-10-21 15:53:03.000000000 +0200 +@@ -685,6 +685,14 @@ + return; + } + ++#ifdef __FreeBSD_kernel__ ++ /* The kernel of FreeBSD expects userland to set TERM. Usualy, we want ++ "cons25". Later, gettys might disagree on this (i.e. we're not using ++ syscons) but some boot scripts, like /etc/init.d/xserver-xorg, still ++ need a non-dumb terminal. */ ++ putenv ("TERM=cons25"); ++#endif ++ + (void) tcgetattr(fd, &tty); + + tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD; --- sysvinit-2.86.ds1.orig/debian/patches/12_doc_lastb.dpatch +++ sysvinit-2.86.ds1/debian/patches/12_doc_lastb.dpatch @@ -0,0 +1,27 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 12_doc_lastb.dpatch by Javier Fernández-Sanguino Peña +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: +## DP: This patch is reported to be incorrect. See bug report for +## DP: more info. +## DP: +## DP: Document the fact that file mode for btmp is important. (bug +## DP: #295335) + +@DPATCH@ +diff -Nru sysvinit-2.86.ds1/man/last.1 sysvinit-2.86.ds1.new/man/last.1 +--- sysvinit-2.86.ds1/man/last.1 2004-07-30 13:39:18.000000000 +0200 ++++ sysvinit-2.86.ds1.new/man/last.1 2005-02-15 08:58:19.000000000 +0100 +@@ -83,6 +83,11 @@ + configuration issue. If you want the files to be used, they can be + created with a simple \fBtouch\fP(1) command (for example, + \fItouch /var/log/wtmp\fP). ++.PP ++Moreover, since the \fIbtmp\fP file might contain sensitive information ++that might be useful for a local attacker, this file is only logged ++to if it is not world readable. In order to get login programs to ++write there you need to \fIchmod 640 /var/log/btmp\fP). + .\"{{{ Files + .SH FILES + /var/log/wtmp --- sysvinit-2.86.ds1.orig/debian/patches/21_ifdown_kfreebsd.dpatch +++ sysvinit-2.86.ds1/debian/patches/21_ifdown_kfreebsd.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 22_ifdown_kfreebsd.dpatch mostly by Robert Millan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Get ifdown working on kFreeBSD. (Closes: #327031) + +@DPATCH@ +--- sysvinit-2.86.ds1.old/src/ifdown.c (revisjon 92) ++++ sysvinit-2.86.ds1/src/ifdown.c (arbeidskopi) +@@ -61,10 +61,19 @@ + continue; + if (strchr(ifr[i].ifr_name, ':') != NULL) + continue; +- ifr[i].ifr_flags &= ~(IFF_UP); +- if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) { +- fprintf(stderr, "ifdown: shutdown "); +- perror(ifr[i].ifr_name); ++/* Expected in according to "UNIX Network Programming". */ ++#ifdef ifr_flags ++#define FLAGS ifr_flags ++#else ++/* Present on kFreeBSD, fixes bug #327031. */ ++#define FLAGS ifr_flagshigh ++#endif ++ if (ifr[i].FLAGS & IFF_UP) { ++ ifr[i].FLAGS &= ~(IFF_UP); ++ if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) { ++ fprintf(stderr, "ifdown: shutdown "); ++ perror(ifr[i].ifr_name); ++ } + } + } + } --- sysvinit-2.86.ds1.orig/debian/patches/13_doc_telinit.dpatch +++ sysvinit-2.86.ds1/debian/patches/13_doc_telinit.dpatch @@ -0,0 +1,76 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 13_doc_telinit.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Document -e and -t option in telinit. Fixes bug #272657. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./man/init.8 /tmp/dpep-work.onJlGf/trunk/man/init.8 +--- ./man/init.8 2006-01-04 11:37:18.000000000 +0100 ++++ /tmp/dpep-work.onJlGf/trunk/man/init.8 2006-01-04 11:37:34.000000000 +0100 +@@ -12,12 +12,15 @@ + .RB [ " -a " ] + .RB [ " -s " ] + .RB [ " -b " ] +-.RB [ " -z xxx " ] ++[ \fB\-z\fP \fIxxx\fP ] + .RB [ " 0123456Ss " ] + .br + .B /sbin/telinit +-.RB [ " \-t sec " ] ++[ \fB\-t\fP \fISECONDS\fP ] + .RB [ " 0123456sSQqabcUu " ] ++.br ++.B /sbin/telinit ++[ \fB\-e\fP \fIVAR\fP[\fB=\fP\fIVAL\fP] ] + .\"}}} + .\"{{{ Description + .SH DESCRIPTION +@@ -155,12 +158,21 @@ + tell \fBinit\fP to switch to single user mode. + .IP "\fBU\fP or \fBu\fP" + tell \fBinit\fP to re-execute itself (preserving the state). No re-examining of +-\fB/etc/inittab\fP file happens. Run level should be one of \fBSs12345\fP, ++\fB/etc/inittab\fP file happens. Run level should be one of ++\fBSs12345\fP + otherwise request would be silently ignored. + .PP +-\fBtelinit\fP can also tell \fBinit\fP how long it should wait ++\fBtelinit\fP can tell \fBinit\fP how long it should wait + between sending processes the SIGTERM and SIGKILL signals. The default +-is 5 seconds, but this can be changed with the \fB-t sec\fP option. ++is 5 seconds, but this can be changed with the \fB-t\fP option. ++.PP ++\fBtelinit -e\fP tells \fBinit\fP to change the environment ++for processes it spawns. ++The argument of \fB-e\fP is either of the form \fIVAR\fP=\fIVAL\fP ++which sets variable \fIVAR\fP to value \fIVAL\fP, ++or of the form \fIVAR\fP ++(without an equality sign) ++which unsets variable \fIVAR\fP. + .PP + \fBtelinit\fP can be invoked only by users with appropriate + privileges. +@@ -212,8 +224,8 @@ + command line manually. + .PP + .TP 0.5i +-.B -z xxx +-The argument to -z is ignored. You can use this to expand the command ++.BI "-z " xxx ++The argument to \fB-z\fP is ignored. You can use this to expand the command + line a bit, so that it takes some more space on the stack. \fBInit\fP + can then manipulate the command line so that \fBps\fP(1) shows + the current runlevel. +diff -urNad --exclude=CVS --exclude=.svn ./src/init.c /tmp/dpep-work.onJlGf/trunk/src/init.c +--- ./src/init.c 2005-12-02 17:22:57.000000000 +0100 ++++ /tmp/dpep-work.onJlGf/trunk/src/init.c 2006-01-04 11:37:19.000000000 +0100 +@@ -2495,7 +2495,7 @@ + */ + void usage(char *s) + { +- fprintf(stderr, "Usage: %s 0123456SsQqAaBbCcUu\n", s); ++ fprintf(stderr, "Usage: %s {-e VAR[=VAL] | [-t SECONDS] {0|1|2|3|4|5|6|S|s|Q|q|A|a|B|b|C|c|U|u}}\n", s); + exit(1); + } + --- sysvinit-2.86.ds1.orig/debian/patches/81_killall_avoid_init.dpatch +++ sysvinit-2.86.ds1/debian/patches/81_killall_avoid_init.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 81_killall_avoid_init.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure we do not try to kill init (pid 1) by mistake. Patch +## DP: from SuSe. + +@DPATCH@ +Index: sysvinit/src/killall5.c +=================================================================== +--- sysvinit/src/killall5.c (revisjon 64) ++++ sysvinit/src/killall5.c (arbeidskopi) +@@ -605,11 +605,11 @@ + exit(1); + } + +- /* Now kill all processes except our session. */ ++ /* Now kill all processes except init (pid 1) and our session. */ + sid = (int)getsid(0); + pid = (int)getpid(); + for (p = plist; p; p = p->next) +- if (p->pid != pid && p->sid != sid && !p->kernel) ++ if (p->pid != 1 && p->pid != pid && p->sid != sid && !p->kernel) + kill(p->pid, sig); + + /* And let them continue. */ --- sysvinit-2.86.ds1.orig/debian/patches/80_killall_sched.dpatch +++ sysvinit-2.86.ds1/debian/patches/80_killall_sched.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 80_killall_sched.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Force the kernel to reschedule after killing processes. Patch +## DP: from SuSe. + +@DPATCH@ +Index: sysvinit/src/killall5.c +=================================================================== +--- sysvinit/src/killall5.c (revisjon 64) ++++ sysvinit/src/killall5.c (arbeidskopi) +@@ -618,5 +618,8 @@ + /* Done. */ + closelog(); + ++ /* Force the kernel to run the scheduler */ ++ usleep(1); ++ + return 0; + } --- sysvinit-2.86.ds1.orig/debian/patches/50_bootlogd_exitcode.dpatch +++ sysvinit-2.86.ds1/debian/patches/50_bootlogd_exitcode.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 50_bootlogd_exitcode.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure bootlogd return non-error exit code when forking off the +## DP: child. Fixes bug #326640. + +@DPATCH@ +Index: sysvinit/src/bootlogd.c +=================================================================== +--- sysvinit/src/bootlogd.c (revisjon 56) ++++ sysvinit/src/bootlogd.c (arbeidskopi) +@@ -523,8 +523,19 @@ + * Fork and write pidfile if needed. + */ + if (!dontfork) { +- if (fork()) ++ pid_t child_pid = fork(); ++ switch (child_pid) { ++ case -1: /* I am parent and the attempt to create a child failed */ ++ fprintf(stderr, "bootlogd: fork failed: %s\n", ++ strerror(errno)); + exit(1); ++ break; ++ case 0: /* I am the child */ ++ break; ++ default: /* I am parent and got child's pid */ ++ exit(0); ++ break; ++ } + setsid(); + } + if (pidfile) { --- sysvinit-2.86.ds1.orig/debian/patches/14_doc_fsf_addr.dpatch +++ sysvinit-2.86.ds1/debian/patches/14_doc_fsf_addr.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 14_doc_fsf_addr.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Update the address of FSF in the copyright file. + +@DPATCH@ +Index: sysvinit/COPYRIGHT +=================================================================== +--- sysvinit/COPYRIGHT (revision 93) ++++ sysvinit/COPYRIGHT (working copy) +@@ -12,7 +12,7 @@ + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software +- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + On Debian GNU/Linux systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL'. --- sysvinit-2.86.ds1.orig/debian/patches/20_pidof.dpatch +++ sysvinit-2.86.ds1/debian/patches/20_pidof.dpatch @@ -0,0 +1,99 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20_pidof.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Modify pidof to not print empty line if no pid was found. (bug: #225476) + +@DPATCH@ +--- sysvinit-2.86.ds1.orig/src/killall5.c ++++ sysvinit-2.86.ds1/src/killall5.c +@@ -378,8 +391,8 @@ + int foundone = 0; + int ok = 0; + +- /* Try to stat the executable. */ +- if (prog[0] == '/' && stat(prog, &st) == 0) dostat++; ++ if (! prog) ++ return NULL; + + /* Get basename of program. */ + if ((s = strrchr(prog, '/')) == NULL) +@@ -387,9 +400,16 @@ + else + s++; + ++ if (! *s) ++ return NULL; ++ + q = (PIDQ_HEAD *)xmalloc(sizeof(PIDQ_HEAD)); + q = init_pid_q(q); + ++ /* Try to stat the executable. */ ++ if (prog[0] == '/' && stat(prog, &st) == 0) ++ dostat++; ++ + /* First try to find a match based on dev/ino pair. */ + if (dostat) { + for (p = plist; p; p = p->next) { +@@ -404,15 +424,35 @@ + if (!foundone) for (p = plist; p; p = p->next) { + ok = 0; + +- /* Compare name (both basename and full path) */ +- ok += (p->argv0 && strcmp(p->argv0, prog) == 0); +- ok += (p->argv0 && strcmp(p->argv0base, s) == 0); ++ /* matching nonmatching ++ * proc name prog name prog name ++ * --- ----------- ------------ ++ * b b, p/b, q/b ++ * p/b b, p/b q/b ++ * ++ * Algorithm: Match if: ++ * cmd = arg ++ * or cmd = base(arg) ++ * or base(cmd) = arg ++ * ++ * Specifically, do not match just because base(cmd) = base(arg) ++ * as was done in earlier versions of this program, since this ++ * allows /aaa/foo to match /bbb/foo . ++ */ ++ ok |= ++ (p->argv0 && strcmp(p->argv0, prog) == 0) ++ || (p->argv0 && s != prog && strcmp(p->argv0, s) == 0) ++ || (p->argv0base && strcmp(p->argv0base, prog) == 0); + + /* For scripts, compare argv[1] as well. */ +- if (scripts_too && p->argv1 && +- !strncmp(p->statname, p->argv1base, STATNAMELEN)) { +- ok += (strcmp(p->argv1, prog) == 0); +- ok += (strcmp(p->argv1base, s) == 0); ++ if ( ++ scripts_too && p->statname && p->argv1base ++ && !strncmp(p->statname, p->argv1base, STATNAMELEN) ++ ) { ++ ok |= ++ (p->argv1 && strcmp(p->argv1, prog) == 0) ++ || (p->argv1 && s != prog && strcmp(p->argv1, s) == 0) ++ || (p->argv1base && strcmp(p->argv1base, prog) == 0); + } + + /* +@@ -423,7 +463,7 @@ + (p->argv0 == NULL || + p->argv0[0] == 0 || + strchr(p->argv0, ' '))) { +- ok += (strcmp(p->statname, s) == 0); ++ ok |= (strcmp(p->statname, s) == 0); + } + if (ok) add_pid_to_q(q, p); + } +@@ -548,7 +588,8 @@ + } + } + } +- printf("\n"); ++ if (!first) ++ printf("\n"); + closelog(); + return(first ? 1 : 0); + } --- sysvinit-2.86.ds1.orig/debian/patches/11_doc_mountpoint.dpatch +++ sysvinit-2.86.ds1/debian/patches/11_doc_mountpoint.dpatch @@ -0,0 +1,15 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 11_doc_mountpoint.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Use correct section number in manual page. + +@DPATCH@ +--- sysvinit-2.86.ds1.orig/man/mountpoint.1 ++++ sysvinit-2.86.ds1/man/mountpoint.1 +@@ -1,5 +1,5 @@ +-.TH MOUNTPOINT 8 "Mar 15, 2004" "" "Linux System Administrator's Manual" ++.TH MOUNTPOINT 1 "Mar 15, 2004" "" "Linux System Administrator's Manual" + .SH NAME + mountpoint \- see if a directory is a mountpoint + .SH SYNOPSIS --- sysvinit-2.86.ds1.orig/debian/patches/60_init_race.dpatch +++ sysvinit-2.86.ds1/debian/patches/60_init_race.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 60_init_race.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Avoid race condition when starting programs during boot. Patch +## DP: found in SuSe. Fixes bug #327612. + +@DPATCH@ +Index: sysvinit/src/init.c +=================================================================== +--- sysvinit/src/init.c (revisjon 62) ++++ sysvinit/src/init.c (arbeidskopi) +@@ -966,6 +966,7 @@ + dup(f); + dup(f); + } ++ SETSIG(sa, SIGCHLD, SIG_DFL, SA_RESTART); + if ((pid = fork()) < 0) { + initlog(L_VB, "cannot fork"); + exit(1); +@@ -978,7 +979,6 @@ + SETSIG(sa, SIGINT, SIG_IGN, SA_RESTART); + SETSIG(sa, SIGTSTP, SIG_IGN, SA_RESTART); + SETSIG(sa, SIGQUIT, SIG_IGN, SA_RESTART); +- SETSIG(sa, SIGCHLD, SIG_DFL, SA_RESTART); + + while ((rc = waitpid(pid, &st, 0)) != pid) + if (rc < 0 && errno == ECHILD) --- sysvinit-2.86.ds1.orig/debian/patches/30_strip.dpatch +++ sysvinit-2.86.ds1/debian/patches/30_strip.dpatch @@ -0,0 +1,64 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_strip.dpatch by Petter Reinholdtsten +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure installed binaries are stripped. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./src/Makefile /tmp/dpep-work.wBpMdg/trunk/src/Makefile +--- ./src/Makefile 2005-12-19 22:45:14.000000000 +0100 ++++ /tmp/dpep-work.wBpMdg/trunk/src/Makefile 2005-12-20 01:07:14.000000000 +0100 +@@ -46,7 +46,9 @@ + BIN_OWNER = root + BIN_GROUP = root + BIN_COMBO = $(BIN_OWNER):$(BIN_GROUP) +-INSTALL = install -o $(BIN_OWNER) -g $(BIN_GROUP) ++STRIP = strip -s -R .comment ++INSTALL_EXEC = install -o $(BIN_OWNER) -g $(BIN_GROUP) -m 755 ++INSTALL_DATA = install -o $(BIN_OWNER) -g $(BIN_GROUP) -m 644 + MANDIR = /usr/share/man + + # Additional libs for GNU libc. +@@ -111,15 +113,18 @@ + + install: + for i in $(BIN); do \ +- $(INSTALL) -m 755 $$i $(ROOT)/bin/; \ ++ $(STRIP) $$i ; \ ++ $(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \ + done + for i in $(SBIN); do \ +- $(INSTALL) -m 755 $$i $(ROOT)/sbin/; \ ++ $(STRIP) $$i ; \ ++ $(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \ + done + for i in $(USRBIN); do \ +- $(INSTALL) -m 755 $$i $(ROOT)/usr/bin/; \ ++ $(STRIP) $$i ; \ ++ $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \ + done +- # $(INSTALL) -m 755 etc/initscript.sample $(ROOT)/etc/ ++ # $(INSTALL_EXEC) etc/initscript.sample $(ROOT)/etc/ + ln -sf halt $(ROOT)/sbin/reboot + ln -sf halt $(ROOT)/sbin/poweroff + ln -sf init $(ROOT)/sbin/telinit +@@ -127,15 +132,15 @@ + if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ + ln -sf last $(ROOT)/usr/bin/lastb; \ + fi +- $(INSTALL) -m 644 initreq.h $(ROOT)/usr/include/ ++ $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/ + for i in $(MAN1); do \ +- $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man1/; \ ++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \ + done + for i in $(MAN5); do \ +- $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man5/; \ ++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \ + done + for i in $(MAN8); do \ +- $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man8/; \ ++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \ + done + ifeq ($(ROOT),) + # --- sysvinit-2.86.ds1.orig/debian/patches/71_wall_hostname.dpatch +++ sysvinit-2.86.ds1/debian/patches/71_wall_hostname.dpatch @@ -0,0 +1,48 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 71_wall_hostname.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Include hostname in output from halt. Closes debian bug +## DP: #325772. + +@DPATCH@ +Index: sysvinit/src/dowall.c +=================================================================== +--- sysvinit/src/dowall.c (revisjon 100) ++++ sysvinit/src/dowall.c (arbeidskopi) +@@ -131,6 +131,7 @@ + time_t t; + char term[UT_LINESIZE+6]; + char line[81]; ++ char hostname[256]; /* HOST_NAME_MAX+1 */ + char *date, *p; + char *user, *tty; + int fd, flags; +@@ -144,6 +145,16 @@ + + getuidtty(&user, &tty); + ++ /* Get and report current hostname, to make it easier to find ++ out which machine is being shut down. */ ++ if (0 != gethostname(hostname, sizeof(hostname))) { ++ strncpy(hostname, "[unknown]", sizeof(hostname)-1); ++ } ++ /* If hostname is truncated, it is unspecified if the string ++ is null terminated or not. Make sure we know it is null ++ terminated. */ ++ hostname[sizeof(hostname)-1] = 0; ++ + /* Get the time */ + time(&t); + date = ctime(&t); +@@ -157,8 +168,8 @@ + date); + } else { + snprintf(line, sizeof(line), +- "\007\r\nBroadcast message from %s %s(%s):\r\n\r\n", +- user, tty, date); ++ "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n", ++ user, hostname, tty, date); + } + + /* --- sysvinit-2.86.ds1.orig/debian/patches/01_enable_startpar.dpatch +++ sysvinit-2.86.ds1/debian/patches/01_enable_startpar.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_enable_startpar.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Document the changes needed to build and include startpar in +## DP: the sysvinit package. + +@DPATCH@ +Index: sysvinit/debian/rules +=================================================================== +--- sysvinit/debian/rules (revisjon 83) ++++ sysvinit/debian/rules (arbeidskopi) +@@ -34,7 +34,7 @@ + else + (cd src; make DISTRO=Debian) + endif +-# make -C debian/startpar ++ make -C debian/startpar + cc -W -Wall -s -o debian/readlink debian/readlink.c + touch build + +@@ -92,8 +92,8 @@ + $(tmp)$(doc)/sysvinit/copyright + cat COPYRIGHT >> $(tmp)$(doc)/sysvinit/copyright + install -g root -m 755 debian/postinst $(tmp)/DEBIAN/postinst +-# make -C debian/startpar DESTDIR=$(tmp) install +- dpkg-shlibdeps src/init # debian/startpar/startpar ++ make -C debian/startpar DESTDIR=$(tmp) install ++ dpkg-shlibdeps src/init debian/startpar/startpar + dpkg-gencontrol -psysvinit -P$(tmp) -isp + dpkg --build $(tmp) .. + rm -rf $(tmp) +@@ -198,7 +198,7 @@ + + clean: checkroot unpatch + (cd src; make clobber ) +-# make -C debian/startpar clean ++ make -C debian/startpar clean + rm -f build debian/files debian/substvars debian/readlink + rm -rf $(tmp) + find . -name '*.bak' -o -name '*~' | xargs -r rm -f -- --- sysvinit-2.86.ds1.orig/debian/patches/70_wall_ttyname.dpatch +++ sysvinit-2.86.ds1/debian/patches/70_wall_ttyname.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 70_wall_ttyname.dpatch by Petter Reinholdtsen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Use UT_LINESIZE from instead of hardcoded string +## DP: lengths. Patch from SuSe. + +@DPATCH@ +Index: sysvinit/src/dowall.c +=================================================================== +--- sysvinit/src/dowall.c (revisjon 64) ++++ sysvinit/src/dowall.c (arbeidskopi) +@@ -65,7 +65,7 @@ + uid_t uid; + char *tty; + static char uidbuf[32]; +- static char ttynm[32]; ++ static char ttynm[UT_LINESIZE + 4]; + static int init = 0; + + if (!init) { +@@ -180,7 +180,7 @@ + utmp->ut_user[0] == 0) continue; + if (strncmp(utmp->ut_line, "/dev/", 5) == 0) { + term[0] = 0; +- strncat(term, utmp->ut_line, UT_LINESIZE); ++ strncat(term, utmp->ut_line, sizeof(term)-1); + } else + snprintf(term, sizeof(term), "/dev/%.*s", + UT_LINESIZE, utmp->ut_line); --- sysvinit-2.86.ds1.orig/debian/patches/31_build_warnings.dpatch +++ sysvinit-2.86.ds1/debian/patches/31_build_warnings.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 31_build_warnings.dpatch by Petter Reinholdtsten +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Increase the compiler warning level. + +@DPATCH@ +Index: trunk/src/Makefile +=================================================================== +--- trunk/src/Makefile (revisjon 62) ++++ trunk/src/Makefile (arbeidskopi) +@@ -9,7 +9,7 @@ + # + + CC = gcc +-CFLAGS = -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE ++CFLAGS = -ansi -W -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE + LDFLAGS = -s + STATIC = + --- sysvinit-2.86.ds1.orig/debian/patches/16_doc_runlevel.dpatch +++ sysvinit-2.86.ds1/debian/patches/16_doc_runlevel.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 16_doc_runlevel.dpatch by Scott James Remnant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad sysvinit-2.86.ds1~/man/runlevel.8 sysvinit-2.86.ds1/man/runlevel.8 +--- sysvinit-2.86.ds1~/man/runlevel.8 1997-05-27 11:33:54.000000000 +0100 ++++ sysvinit-2.86.ds1/man/runlevel.8 2006-05-18 02:06:08.000000000 +0100 +@@ -1,6 +1,6 @@ + .TH RUNLEVEL 8 "May 27, 1997" "" "Linux System Administrator's Manual" + .SH NAME +-runlevel -- find the current and previous system runlevel. ++runlevel -- find the previous and current system runlevel. + .SH SYNOPSIS + .B runlevel + .RI [ utmp ] --- sysvinit-2.86.ds1.orig/debian/patches/99_ubuntu_02_splash.dpatch +++ sysvinit-2.86.ds1/debian/patches/99_ubuntu_02_splash.dpatch @@ -0,0 +1,47 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 99_ubuntu_02_splash.dpatch by Scott James Remnant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: If the splash argument is given on the command-line, don't print +## DP: the boot message; if not given, print the boot message in our style. + +@DPATCH@ +diff -urNad sysvinit-2.86.ds1~/src/init.c sysvinit-2.86.ds1/src/init.c +--- sysvinit-2.86.ds1~/src/init.c 2005-12-07 13:57:30.173759500 +0000 ++++ sysvinit-2.86.ds1/src/init.c 2005-12-07 13:58:00.975684500 +0000 +@@ -115,6 +115,7 @@ + char *console_dev; /* Console device. */ + int pipe_fd = -1; /* /dev/initctl */ + int did_boot = 0; /* Did we already do BOOT* stuff? */ ++int quietinit = 0; /* Should init be quiet on load? */ + int main(int, char **); + + /* Used by re-exec part */ +@@ -764,7 +765,7 @@ + * And log to the console. + */ + if (loglevel & L_CO) { +- print("\rINIT: "); ++ print("\r * INIT: "); + print(buf); + print("\r\n"); + } +@@ -2423,7 +2424,8 @@ + /* + * Say hello to the world + */ +- initlog(L_CO, bootmsg, "booting"); ++ if (!quietinit) ++ initlog(L_CO, bootmsg, "booting"); + + /* + * See if we have to start an emergency shell. +@@ -2651,6 +2653,8 @@ + putenv("AUTOBOOT=YES"); + else if (!strcmp(argv[f], "-b") || !strcmp(argv[f],"emergency")) + emerg_shell = 1; ++ else if (!strcmp(argv[f], "-s") || !strcmp(argv[f],"splash")) ++ quietinit = 1; + else if (!strcmp(argv[f], "-z")) { + /* Ignore -z xxx */ + if (argv[f + 1]) f++; --- sysvinit-2.86.ds1.orig/debian/patches/45_pidof_symlink.dpatch +++ sysvinit-2.86.ds1/debian/patches/45_pidof_symlink.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 45_pidof_symlink.dpatch by Thomas Hood +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make pidof an absolute symlink + +@DPATCH@ +Index: trunk/src/Makefile +=================================================================== +--- trunk/src/Makefile.orig 2005-12-19 22:49:03.000000000 +0100 ++++ trunk/src/Makefile 2005-12-19 22:50:15.000000000 +0100 +@@ -139,7 +139,7 @@ + ln -sf halt $(ROOT)/sbin/reboot + ln -sf halt $(ROOT)/sbin/poweroff + ln -sf init $(ROOT)/sbin/telinit +- ln -sf ../sbin/killall5 $(ROOT)/bin/pidof ++ ln -sf /sbin/killall5 $(ROOT)/bin/pidof + if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ + ln -sf last $(ROOT)/usr/bin/lastb; \ + fi --- sysvinit-2.86.ds1.orig/debian/patches/52_bootlogd_createlogfile.dpatch +++ sysvinit-2.86.ds1/debian/patches/52_bootlogd_createlogfile.dpatch @@ -0,0 +1,91 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 52_bootlogd_createlogfile.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./man/bootlogd.8 /tmp/dpep-work.PNSf00/trunk/man/bootlogd.8 +--- ./man/bootlogd.8 2006-03-19 17:51:42.000000000 +0100 ++++ /tmp/dpep-work.PNSf00/trunk/man/bootlogd.8 2006-03-19 17:51:42.000000000 +0100 +@@ -3,6 +3,7 @@ + bootlogd \- record boot messages + .SH SYNOPSIS + .B /sbin/bootlogd ++.RB [ \-c ] + .RB [ \-d ] + .RB [ \-r ] + .RB [ \-s ] +@@ -16,6 +17,12 @@ + .SH OPTIONS + .IP \fB\-d\fP + Do not fork and run in the background. ++.IP \fB\-c\fP ++Attempt to write to the logfile even if it does not yet exist. ++Without this option, ++.B bootlogd ++will wait for the logfile to appear before attempting to write to it. ++This behavior prevents bootlogd from creating logfiles under mount points. + .IP \fB\-r\fP + If there is an existing logfile called \fIlogfile\fP rename it to + \fIlogfile~\fP unless \fIlogfile~\fP already exists. +diff -urNad --exclude=CVS --exclude=.svn ./src/bootlogd.c /tmp/dpep-work.PNSf00/trunk/src/bootlogd.c +--- ./src/bootlogd.c 2006-03-19 17:51:42.000000000 +0100 ++++ /tmp/dpep-work.PNSf00/trunk/src/bootlogd.c 2006-03-19 17:52:39.000000000 +0100 +@@ -56,6 +56,7 @@ + + int got_signal = 0; + int didnl = 1; ++int createlogfile = 0; + int syncalot = 0; + + struct line { +@@ -385,7 +386,7 @@ + */ + void usage(void) + { +- fprintf(stderr, "Usage: bootlogd [-v] [-r] [-d] [-p pidfile] [-l logfile]\n"); ++ fprintf(stderr, "Usage: bootlogd [-v] [-r] [-d] [-s] [-c] [-p pidfile] [-l logfile]\n"); + exit(1); + } + +@@ -447,7 +448,7 @@ + rotate = 0; + dontfork = 0; + +- while ((i = getopt(argc, argv, "dsl:p:rv")) != EOF) switch(i) { ++ while ((i = getopt(argc, argv, "cdsl:p:rv")) != EOF) switch(i) { + case 'l': + logfile = optarg; + break; +@@ -461,6 +462,9 @@ + case 'p': + pidfile = optarg; + break; ++ case 'c': ++ createlogfile = 1; ++ break; + case 'd': + dontfork = 1; + break; +@@ -613,12 +617,16 @@ + /* + * Perhaps we need to open the logfile. + */ +- if (fp == NULL && rotate && access(logfile, F_OK) == 0) { +- snprintf(buf, sizeof(buf), "%s~", logfile); +- rename(logfile, buf); ++ if (fp == NULL && access(logfile, F_OK) == 0) { ++ if (rotate) { ++ snprintf(buf, sizeof(buf), "%s~", logfile); ++ rename(logfile, buf); ++ } ++ fp = fopen(logfile, "a"); + } +- if (fp == NULL) ++ if (fp == NULL && createlogfile) + fp = fopen(logfile, "a"); ++ + if (inptr >= outptr) + todo = inptr - outptr; + else --- sysvinit-2.86.ds1.orig/debian/patches/41_selinux_console.dpatch +++ sysvinit-2.86.ds1/debian/patches/41_selinux_console.dpatch @@ -0,0 +1,74 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 41_selinux_console.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./src/init.c /tmp/dpep-work.tcSHzc/trunk/src/init.c +--- ./src/init.c 2006-01-27 16:52:38.000000000 +0100 ++++ /tmp/dpep-work.tcSHzc/trunk/src/init.c 2006-01-27 16:55:20.000000000 +0100 +@@ -89,6 +89,7 @@ + + /* Mount point for selinuxfs. */ + #define SELINUXMNT "/selinux/" ++#define BUF_CHARS (size_t)4096 + int enforcing = -1; /* SELinux enforcing mode */ + + static int load_policy(int *enforce) +@@ -101,16 +102,20 @@ + int policy_version=0; + extern char *selinux_mnt; + FILE *cfg; +- char buf[4096]; ++ char *buf; + int seconfig = -2; + ++ buf = malloc(BUF_CHARS * sizeof(char)); ++ if (!buf) ++ return -1; ++ + selinux_getenforcemode(&seconfig); + + mount("none", "/proc", "proc", 0, 0); + cfg = fopen("/proc/cmdline","r"); + if (cfg) { + char *tmp; +- if (fgets(buf,4096,cfg) && (tmp = strstr(buf,"enforcing="))) { ++ if (fgets(buf, BUF_CHARS, cfg) && (tmp = strstr(buf, "enforcing="))) { + if (tmp == buf || isspace(*(tmp-1))) { + enforcing=atoi(tmp+10); + } +@@ -127,14 +132,21 @@ + + if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0) { + if (errno == ENODEV) { +- printf("SELinux not supported by kernel: %s\n",strerror(errno)); + *enforce = 0; ++ snprintf(buf, BUF_CHARS, "Warning: SELinux not supported by kernel: %s\n",strerror(errno)); ++ print(buf); ++ free(buf); ++ return ret; + } else { +- printf("Failed to mount %s: %s\n",SELINUXMNT,strerror(errno)); ++ snprintf(buf, BUF_CHARS, "Failed to mount %s: %s\n",SELINUXMNT,strerror(errno)); ++ print(buf); ++ free(buf); ++ return -1; + } +- return ret; + } + ++ free(buf); ++ + selinux_mnt = SELINUXMNT; /* set manually since we mounted it */ + + policy_version=security_policyvers(); +@@ -228,6 +240,7 @@ + } + return(ret); + } ++#undef BUF_CHARS + #endif + + --- sysvinit-2.86.ds1.orig/debian/patches/63_init_longer_procname.dpatch +++ sysvinit-2.86.ds1/debian/patches/63_init_longer_procname.dpatch @@ -0,0 +1,23 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 63_init_longer_procname.dpatch by Kir Kolyshkin +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Terminate argv0 with one 0 rather than two so that process +## DP: name can be one character longer + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./src/init.c /tmp/dpep-work.aSvxrG/trunk/src/init.c +--- ./src/init.c 2006-01-04 17:44:08.000000000 +0100 ++++ /tmp/dpep-work.aSvxrG/trunk/src/init.c 2006-01-04 17:44:20.000000000 +0100 +@@ -615,9 +615,9 @@ + len = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + +- if (maxproclen > 2) { ++ if (maxproclen > 1) { + memset(argv0, 0, maxproclen); +- strncpy(argv0, buf, maxproclen - 2); ++ strncpy(argv0, buf, maxproclen - 1); + } + + return len; --- sysvinit-2.86.ds1.orig/debian/patches/51_bootlogd_syncalot.dpatch +++ sysvinit-2.86.ds1/debian/patches/51_bootlogd_syncalot.dpatch @@ -0,0 +1,76 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 51_bootlogd_syncalot.dpatch by Thomas Hood +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Only fdatasync() if -s option given + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./man/bootlogd.8 /tmp/dpep-work.bY0gSg/trunk/man/bootlogd.8 +--- ./man/bootlogd.8 2006-01-23 11:17:20.000000000 +0100 ++++ /tmp/dpep-work.bY0gSg/trunk/man/bootlogd.8 2006-01-23 11:23:47.000000000 +0100 +@@ -5,6 +5,7 @@ + .B /sbin/bootlogd + .RB [ \-d ] + .RB [ \-r ] ++.RB [ \-s ] + .RB [ \-v ] + .RB [ " -l logfile " ] + .RB [ " -p pidfile " ] +@@ -18,6 +19,12 @@ + .IP \fB\-r\fP + If there is an existing logfile called \fIlogfile\fP rename it to + \fIlogfile~\fP unless \fIlogfile~\fP already exists. ++.IP \fB\-s\fP ++Ensure that the data is written to the file after each line by calling ++.BR fdatasync (3). ++This will slow down a ++.BR fsck (8) ++process running in parallel. + .IP \fB\-v\fP + Show version. + .IP "\fB\-l\fP \fIlogfile\fP" +@@ -38,4 +45,4 @@ + .SH AUTHOR + Miquel van Smoorenburg, miquels@cistron.nl + .SH "SEE ALSO" +-.BR dmesg (8) ++.BR dmesg "(8), " fdatasync (3). +diff -urNad --exclude=CVS --exclude=.svn ./src/bootlogd.c /tmp/dpep-work.bY0gSg/trunk/src/bootlogd.c +--- ./src/bootlogd.c 2006-01-23 11:17:21.000000000 +0100 ++++ /tmp/dpep-work.bY0gSg/trunk/src/bootlogd.c 2006-01-23 11:19:23.000000000 +0100 +@@ -56,6 +56,7 @@ + + int got_signal = 0; + int didnl = 1; ++int syncalot = 0; + + struct line { + char buf[256]; +@@ -337,7 +338,7 @@ + break; + case '\n': + didnl = 1; +- dosync = 1; ++ dosync = syncalot; + break; + case '\t': + line.pos += (line.pos / 8 + 1) * 8; +@@ -446,7 +447,7 @@ + rotate = 0; + dontfork = 0; + +- while ((i = getopt(argc, argv, "dl:p:rv")) != EOF) switch(i) { ++ while ((i = getopt(argc, argv, "dsl:p:rv")) != EOF) switch(i) { + case 'l': + logfile = optarg; + break; +@@ -463,6 +464,9 @@ + case 'd': + dontfork = 1; + break; ++ case 's': ++ syncalot = 1; ++ break; + default: + usage(); + break; --- sysvinit-2.86.ds1.orig/debian/patches/25_last_sanify.dpatch +++ sysvinit-2.86.ds1/debian/patches/25_last_sanify.dpatch @@ -0,0 +1,48 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 25_last_sanify.dpatch by Thomas Hood +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: In "last -x" output: +## DP: + On "reboot" line print endpoint of uptime too +## DP: + On "shutdown" line print downtime rather that time between downs +## DP: (Closes: #58119) + + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./src/last.c /tmp/dpep-work.yygu5p/trunk/src/last.c +--- ./src/last.c 2005-12-02 17:22:57.000000000 +0100 ++++ /tmp/dpep-work.yygu5p/trunk/src/last.c 2006-02-19 22:35:31.000000000 +0100 +@@ -418,7 +418,6 @@ + sprintf(length, "- no logout"); + break; + case R_REBOOT: +- logouttime[0] = 0; /* Print machine uptime */ + break; + case R_TIMECHANGE: + logouttime[0] = 0; +@@ -717,7 +716,7 @@ + ut.ut_type = SHUTDOWN_TIME; + else if (strncmp(ut.ut_user, "reboot", 6) == 0) + ut.ut_type = BOOT_TIME; +- else if (strncmp(ut.ut_user, "runlevel", 7) == 0) ++ else if (strncmp(ut.ut_user, "runlevel", 8) == 0) + ut.ut_type = RUN_LVL; + } + #if 1 /*def COMPAT*/ +@@ -752,7 +751,7 @@ + case SHUTDOWN_TIME: + if (extended) { + strcpy(ut.ut_line, "system down"); +- quit = list(&ut, lastdown, R_NORMAL); ++ quit = list(&ut, lastboot, R_NORMAL); + } + lastdown = lastrch = ut.ut_time; + down = 1; +@@ -769,6 +768,7 @@ + case BOOT_TIME: + strcpy(ut.ut_line, "system boot"); + quit = list(&ut, lastdown, R_REBOOT); ++ lastboot = ut.ut_time; + down = 1; + break; + case RUN_LVL: --- sysvinit-2.86.ds1.orig/debian/patches/65_init_u_in_06.dpatch +++ sysvinit-2.86.ds1/debian/patches/65_init_u_in_06.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 65_init_u_in_06.dpatch by Thomas Hood +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Allow 'telinit u' in runlevels 0 and 6 + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./man/init.8 /tmp/dpep-work.ZhzV9R/trunk/man/init.8 +--- ./man/init.8 2006-01-04 11:38:11.000000000 +0100 ++++ /tmp/dpep-work.ZhzV9R/trunk/man/init.8 2006-01-04 11:38:26.000000000 +0100 +@@ -159,7 +159,7 @@ + .IP "\fBU\fP or \fBu\fP" + tell \fBinit\fP to re-execute itself (preserving the state). No re-examining of + \fB/etc/inittab\fP file happens. Run level should be one of +-\fBSs12345\fP ++\fBSs0123456\fP + otherwise request would be silently ignored. + .PP + \fBtelinit\fP can tell \fBinit\fP how long it should wait +diff -urNad --exclude=CVS --exclude=.svn ./src/init.c /tmp/dpep-work.ZhzV9R/trunk/src/init.c +--- ./src/init.c 2006-01-04 11:38:12.000000000 +0100 ++++ /tmp/dpep-work.ZhzV9R/trunk/src/init.c 2006-01-04 11:38:12.000000000 +0100 +@@ -1996,7 +1996,7 @@ + char **env; + int fd; + +- if (strchr("S12345",runlevel) == NULL) ++ if (strchr("S0123456",runlevel) == NULL) + return; + + /* --- sysvinit-2.86.ds1.orig/debian/patches/fix-minor-warnings +++ sysvinit-2.86.ds1/debian/patches/fix-minor-warnings @@ -0,0 +1,123 @@ +Index: src/last.c +=================================================================== +--- src/last.c (revision 290) ++++ src/last.c (working copy) +@@ -320,7 +320,7 @@ + * + * Ugly. + */ +- if (a[0] == 0 && a[1] == 0 && a[2] == htonl (0xffff)) ++ if (a[0] == 0 && a[1] == 0 && a[2] == (int32_t)htonl (0xffff)) + mapped = 1; + topnibble = ntohl((unsigned int)a[0]) >> 28; + if (topnibble < 2 || topnibble > 3 || mapped || +@@ -436,7 +436,7 @@ + r = dns_lookup(domain, sizeof(domain), useip, p->ut_addr_v6); + if (r < 0) { + len = UT_HOSTSIZE; +- if (len >= sizeof(domain)) len = sizeof(domain) - 1; ++ if (len >= (int)sizeof(domain)) len = sizeof(domain) - 1; + domain[0] = 0; + strncat(domain, p->ut_host, len); + } +Index: src/init.c +=================================================================== +--- src/init.c (revision 290) ++++ src/init.c (working copy) +@@ -561,7 +561,8 @@ + * Find out which process(es) this was (were) + */ + while((pid = waitpid(-1, &st, WNOHANG)) != 0) { +- if (errno == ECHILD) break; ++ if (errno == ECHILD) ++ break; + for( ch = family; ch; ch = ch->next ) + if ( ch->pid == pid && (ch->flags & RUNNING) ) { + INITDBG(L_VB, +@@ -576,9 +577,10 @@ + } + break; + } +- if (ch == NULL) ++ if (ch == NULL) { + INITDBG(L_VB, "chld_handler: unknown child %d exited.", + pid); ++ } + } + errno = saved_errno; + } +@@ -1237,7 +1239,7 @@ + strncpy(ch->id, id, sizeof(utproto.ut_id) + 1); /* Hack for different libs. */ + strncpy(ch->process, process, sizeof(ch->process) - 1); + if (rlevel[0]) { +- for(f = 0; f < sizeof(rlevel) - 1 && rlevel[f]; f++) { ++ for(f = 0; f < (int)sizeof(rlevel)-1 && rlevel[f]; f++) { + ch->rlevel[f] = rlevel[f]; + if (ch->rlevel[f] == 's') ch->rlevel[f] = 'S'; + } +Index: src/bootlogd.c +=================================================================== +--- src/bootlogd.c (revision 290) ++++ src/bootlogd.c (working copy) +@@ -123,7 +123,7 @@ + fprintf(stderr, "bootlogd: cannot find console device " + "%d:%d in /dev\n", major(dev), minor(dev)); + r = -1; +- } else if (strlen(ent->d_name) + 5 >= rlen) { ++ } else if ((int)strlen(ent->d_name) + 5 >= rlen) { + fprintf(stderr, "bootlogd: console device name too long\n"); + r = -1; + } else +@@ -341,7 +341,7 @@ + break; + case '\t': + line.pos += (line.pos / 8 + 1) * 8; +- if (line.pos >= sizeof(line.buf)) ++ if (line.pos >= (int)sizeof(line.buf)) + line.pos = sizeof(line.buf) - 1; + break; + case 32 ... 127: +@@ -357,7 +357,7 @@ + len--; + + tlen = strlen(tmp); +- if (tlen && (line.pos + tlen < sizeof(line.buf))) { ++ if (tlen && (line.pos + tlen < (int)sizeof(line.buf))) { + memcpy(line.buf + line.pos, tmp, tlen); + line.pos += tlen; + } +@@ -609,7 +609,7 @@ + else + todo = endptr - outptr; + if (fp && todo) +- writelog(fp, outptr, todo); ++ writelog(fp, (unsigned char *)outptr, todo); + } + + if (fp) { +Index: src/shutdown.c +=================================================================== +--- src/shutdown.c (revision 290) ++++ src/shutdown.c (working copy) +@@ -141,7 +141,7 @@ + nl = strlen(name); + vl = value ? strlen(value) : 0; + +- if (nl + vl + 3 >= sizeof(request.i.data)) ++ if (nl + vl + 3 >= (int)sizeof(request.i.data)) + return -1; + + memcpy(request.i.data, name, nl); +Index: src/sulogin.c +=================================================================== +--- src/sulogin.c (revision 290) ++++ src/sulogin.c (working copy) +@@ -275,7 +275,7 @@ + if (read(0, pass, sizeof(pass) - 1) <= 0) + ret = NULL; + else { +- for(i = 0; i < sizeof(pass) && pass[i]; i++) ++ for(i = 0; i < (int)sizeof(pass) && pass[i]; i++) + if (pass[i] == '\r' || pass[i] == '\n') { + pass[i] = 0; + break; --- sysvinit-2.86.ds1.orig/debian/patches/64_init_set_PATH.dpatch +++ sysvinit-2.86.ds1/debian/patches/64_init_set_PATH.dpatch @@ -0,0 +1,46 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 64_init_set_PATH.dpatch by Thomas Hood +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Set PATH to a sane value if it is unset on re-exec. +## DP: Use setenv() instead of putenv() to set PATH since the latter +## DP: allows the default PATH string to be clobbered, rendering it +## DP: not reusable on re-exec. + +@DPATCH@ +diff -ur sysvinit-2.86.ds1/src/init.c_ORIG sysvinit-2.86.ds1/src/init.c +--- sysvinit-2.86.ds1/src/init.c_ORIG 2005-12-31 11:51:03.000000000 +0100 ++++ sysvinit-2.86.ds1/src/init.c 2005-12-31 11:58:48.000000000 +0100 +@@ -2573,7 +2573,7 @@ + /* + * Set default PATH variable. + */ +- putenv(PATH_DFL); ++ setenv("PATH", PATH_DEFAULT, 1 /* Overwrite */); + + /* + * Initialize /var/run/utmp (only works if /var is on +@@ -2612,6 +2612,11 @@ + initlog(L_CO, bootmsg, "reloading"); + sigfillset(&sgt); + sigprocmask(SIG_UNBLOCK, &sgt, NULL); ++ ++ /* ++ * Set default PATH variable. ++ */ ++ setenv("PATH", PATH_DEFAULT, 0 /* Don't overwrite */); + } + start_if_needed(); + +diff -urNad --exclude=CVS --exclude=.svn ./src/init.h /tmp/dpep-work.2oIDao/trunk/src/init.h +--- sysvinit-2.86.ds1/src/init.h_ORIG 2005-12-02 17:22:57.000000000 +0100 ++++ sysvinit-2.86.ds1/src/init.h 2005-12-31 11:56:18.000000000 +0100 +@@ -24,7 +24,7 @@ + #define SLEEPTIME 300 /* Disable time */ + + /* Default path inherited by every child. */ +-#define PATH_DFL "PATH=/bin:/usr/bin:/sbin:/usr/sbin" ++#define PATH_DEFAULT "/usr/sbin:/usr/bin:/sbin:/bin" + + + /* Prototypes. */ --- sysvinit-2.86.ds1.orig/debian/patches/53_bootlogd_ttyB.dpatch +++ sysvinit-2.86.ds1/debian/patches/53_bootlogd_ttyB.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 53_bootlogd_ttyB.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./src/bootlogd.c /tmp/dpep-work.tNbXVe/trunk/src/bootlogd.c +--- ./src/bootlogd.c 2006-01-23 12:22:09.000000000 +0100 ++++ /tmp/dpep-work.tNbXVe/trunk/src/bootlogd.c 2006-01-23 12:26:26.000000000 +0100 +@@ -73,6 +73,7 @@ + char *dev1; + char *dev2; + } consdev[] = { ++ { "ttyB", "/dev/ttyB%s", NULL }, + { "ttySC", "/dev/ttySC%s", "/dev/ttsc/%s" }, + { "ttyS", "/dev/ttyS%s", "/dev/tts/%s" }, + { "tty", "/dev/tty%s", "/dev/vc/%s" }, +@@ -84,7 +85,7 @@ + * Devices to try as console if not found on kernel command line. + * Tried from left to right (as opposed to kernel cmdline). + */ +-char *defcons[] = { "tty0", "hvc0", "ttyS0", "ttySC0", NULL }; ++char *defcons[] = { "tty0", "hvc0", "ttyS0", "ttySC0", "ttyB0", NULL }; + + /* + * Catch signals. +@@ -271,8 +272,6 @@ + /* + * OK, so find console= in /proc/cmdline. + * Parse in reverse, opening as we go. +- * +- * Valid console devices: ttySC, ttyS, tty, hvc. + */ + p = buf + n; + *p-- = 0; --- sysvinit-2.86.ds1.orig/debian/startpar/startpar.c +++ sysvinit-2.86.ds1/debian/startpar/startpar.c @@ -0,0 +1,1020 @@ +/* Copyright (c) 2003 SuSE Linux AG + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (see the file COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + **************************************************************** + */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "makeboot.h" +#include "proc.h" + +typedef enum _boolean {false, true} boolean; +extern char *optarg; +extern int optind; + +static long int numcpu = -1; +static char *myname; +static struct termios tio; +static struct winsize wz; +static int wzok; +static char *arg; +static struct sigaction sa; +static struct timeval glastio; +static struct timeval now; +static struct timeval lastlim; +static char *run_mode = NULL; +static struct makenode **nodevec; + +#define PBUF_SIZE 8192 +struct prg { + char *name; + int num; + int fd; + pid_t pid; + struct timeval lastio; + size_t len; + int splashadd; + char buf[PBUF_SIZE]; +}; + +static struct prg *prgs; +static int inpar, par; +static int pidpipe[2]; + +void *xcalloc(size_t nmemb, size_t size) +{ + void *r; + if ((r = (void *)calloc(nmemb, size)) == 0) + { + fprintf(stderr, "calloc: out of memory\n"); + exit(1); + } + return r; +} + +static int splashpos = -1; +static char *splashcfg; + +int calcsplash(int x, int n, char *opt) +{ + char *p; + int i; + int r, d; + + if (opt == 0) + return -1; + for (i = 0; i <= x; i++) + { + if ((p = strchr(opt, ':')) == 0) + break; + if (i == x) + return atoi(opt); + opt = p + 1; + } + r = atoi(opt); + n -= i; + for (;; i++, n--) + { + if (n < 1) + n = 1; + d = r / n; + if (i == x) + return d; + r -= d; + } +} + +pid_t splashpid; + +void waitsplash() +{ + int status; + if (!splashpid) + return; + waitpid(splashpid, &status, 0); + splashpid = 0; +} + +void callsplash(int n, char *path, char *action) +{ + char *p; + char sbuf[32]; + char tbuf[256]; + pid_t pid; + struct stat stb; + + if (n < 0 || splashpos < 0) + return; + if (splashpos + n > 65535) + n = 65535 - splashpos; + splashpos += n; + if (stat("/proc/splash", &stb)) + return; + p = strrchr(path, '/'); + if (p) + path = p + 1; + for (p = path; *p; p++) + if ((*p == 'S' || *p == 'K') && p[1] >= '0' && p[1] <= '9' && p[2] >= '0' && p[2] <= '9' && p[3]) + break; + if (*p) + p += 3; + else + p = path; + if (!action) + action = ""; + if (strlen(p) + strlen(action) + 2 > sizeof(tbuf)) + return; + sprintf(tbuf, "%s%s%s", p, *action ? " " : "", action); + sprintf(sbuf, "%d:%d", splashpos - n, n); + waitsplash(); + pid = fork(); + if (pid == (pid_t)-1) + return; + if (pid) + { + splashpid = pid; + return; + } + close(1); + dup(2); + execl("/sbin/splash", "splash", "-p", sbuf, "-t", tbuf, splashcfg, (char *)0); + _exit(1); +} + + +void closeall(void) +{ + int s; + + if (!prgs) + return; + for (s = 0; s < par; s++) + if (prgs[s].fd) + close(prgs[s].fd); + close(pidpipe[0]); + close(pidpipe[1]); +} + +void writebuf(struct prg *p) +{ + char *b = p->buf; + int r; + + while (p->len > 0) + { + r = write(2, b, p->len); + if (r < 0) + { + perror("write"); + r = p->len; + } + p->len -= r; + b += r; + } + glastio.tv_sec = now.tv_sec; + glastio.tv_usec = now.tv_usec; +} + +static int checksystem(const int par, const char *mode, const boolean limit) +{ + const int pg_size = sysconf(_SC_PAGESIZE); + const long int minphys_bytes = (sysconf(_SC_LONG_BIT) > 32L) ? (2<<22) : (2<<21); + const long int avphys_pg = sysconf(_SC_AVPHYS_PAGES); + long int minphys_pg; + unsigned long int prcs_run, prcs_blked; + int newpar; + + if (avphys_pg < 0) + return 1; + + if (pg_size < 0) + return par; + + if (mode && strcmp(mode, "stop") == 0) + minphys_pg = avphys_pg; + else + minphys_pg = minphys_bytes / pg_size; + + if (avphys_pg < minphys_pg) + return 1; + + if (numcpu < 1) + return par; + + if (!limit) + return (par*numcpu); + + if (read_proc(&prcs_run, &prcs_blked)) + return par; + + newpar = (par*numcpu) - prcs_run + 1; /* +1 for startpar its self */ + newpar -= (prcs_blked>>2); /* I/O load reduction */ + +#if DEBUG + fprintf(stderr, "checksystem par=%d newpar=%d (prcs_run=%u) %ld\n", par, newpar, prcs_run, time(0)); +#endif + if (newpar <= 0) + return 1; + else + return newpar; +} + +static inline int checklimit(const int par, const char *mode) +{ + return checksystem(par, mode, true); +} + +static inline int checkpar(const int par, const char *mode) +{ + return checksystem(par, mode, false); +} + +void run(struct prg *p) +{ + char *m = 0; + + p->len = 0; + p->pid = (pid_t)0; + p->fd = getpt(); + if (p->fd <= 0) + { + p->fd = 0; + perror("getpt"); + fprintf(stderr, "could not get pty for %s\n", p->name); + } + else if ((m = ptsname(p->fd)) == 0 || grantpt(p->fd) || unlockpt(p->fd)) + { + fprintf(stderr, "could not init pty for %s\n", p->name); + close(p->fd); + p->fd = 0; + } + if ((p->pid = fork()) == (pid_t)-1) + { + perror("fork"); + fprintf(stderr, "could not fork %s\n", p->name); + p->pid = 0; + if (p->fd) + { + close(p->fd); + p->fd = 0; + } + return; + } + if (p->pid != 0) + return; + + (void)signal(SIGINT, SIG_DFL); + (void)signal(SIGQUIT, SIG_DFL); + (void)signal(SIGSEGV, SIG_DFL); + (void)signal(SIGTERM, SIG_DFL); + + if (setpgid(0, 0)) + perror("setpgid"); + + if (m && p->fd) + { + close(1); + if (open(m, O_RDWR) != 1) + { + perror(m); + _exit(1); + } + close(2); + dup(1); + tio.c_oflag &= ~OPOST; + if (tcsetattr(1, TCSANOW, &tio)) + perror("tcsetattr"); + if (wzok && ioctl(0, TIOCSWINSZ, &wz)) + perror("TIOCSWINSZ"); + } + else + { + close(1); + dup(2); + } + + closeall(); + + if (run_mode) { + char path[128]; + snprintf(path, sizeof(path), "/etc/init.d/%s", p->name); + execlp(path, path, arg, (char *)0); + } else if (arg) + execlp(p->name, p->name, arg, (char *)0); + else + execlp(p->name, p->name, (char *)0); + perror(p->name); + _exit(1); +} + +int run_single(char *prg, int spl) +{ + pid_t pid; + int r; + + if ((pid = fork()) == (pid_t)-1) + { + perror("fork"); + fprintf(stderr, "could not fork %s\n", prg); + return 1; + } + + if (pid == 0) + { + (void)signal(SIGINT, SIG_DFL); + (void)signal(SIGQUIT, SIG_DFL); + (void)signal(SIGSEGV, SIG_DFL); + (void)signal(SIGTERM, SIG_DFL); + + close(1); + dup(2); + if (run_mode) + { + char path[128]; + snprintf(path, sizeof(path), "/etc/init.d/%s", prg); + execlp(path, path, arg, (char *)0); + } + else if (arg) + execlp(prg, prg, arg, (char *)0); + else + execlp(prg, prg, (char *)0); + perror(prg); + _exit(1); + } + + while (waitpid(pid, &r, 0) == (pid_t)-1) + ; + callsplash(spl, prg, arg); + return WIFEXITED(r) ? WEXITSTATUS(r) : (WIFSIGNALED(r) ? 1 : 255); +} + +void do_forward(void) +{ + char buf[4096], *b; + int r, rr; + setsid(); + while ((r = read(0, buf, sizeof(buf))) > 0) + { + b = buf; + while (r > 0) + { + rr = write(1, b, r); + if (rr == -1) + { + perror("write"); + rr = r; + } + r -= rr; + } + } + _exit(0); +} + +static char *gtimo_buf; +static size_t gtimo_bufsize; +static size_t gtimo_buflen; + +void storebuf(struct prg *p) +{ + if ((gtimo_buflen + p->len) > gtimo_bufsize) + { + writebuf(p); /* In case of overflow or memory shortage */ + return; + } + + (void)memcpy(gtimo_buf + gtimo_buflen, p->buf, p->len); + gtimo_buflen += p->len; + p->len = 0; + glastio.tv_sec = now.tv_sec; + glastio.tv_usec = now.tv_usec; +} + +void flushbuf(void) +{ + size_t len = gtimo_buflen; + char * buf = gtimo_buf; + + if (!buf) + return; /* In case of memory shortage */ + + while (len > 0) + { + int r = write(2, buf, len); + if (r < 0) + { + perror("write"); + r = len; + } + len -= r; + buf += r; + } + gtimo_buflen = 0; + *gtimo_buf = 0; +} + +#define GTIMO_OFFL 0 +#define GTIMO_USED 1 + +void detach(struct prg *p, const int store) +{ + int r; + int flags = fcntl(p->fd, F_GETFL); + + if (flags > 0) + flags |= FNONBLOCK; + else + flags = FNONBLOCK; + + fcntl(p->fd, F_SETFL, flags); + while ((r = read(p->fd, p->buf, sizeof(p->buf))) > 0) + { + p->len = r; + if (store) + storebuf(p); + else + writebuf(p); + } + flags &= ~FNONBLOCK; + fcntl(p->fd, F_SETFL, flags); + if (r == -1 && errno == EWOULDBLOCK) + { + if ((r = fork()) == 0) + { + close(0); + dup(p->fd); + close(1); + dup(2); + closeall(); + execlp(myname, myname, "-f", "--", p->name, NULL); + do_forward(); + } + if (r == -1) + perror("fork"); + } + close(p->fd); + p->fd = 0; +} + +void sigchld(int sig __attribute__ ((unused))) +{ + char c = 0; + write(pidpipe[1], &c, 1); +} + +void usage(int status) +{ + fprintf(stderr, "usage: startpar [options] [-a arg] prgs\n"); + fprintf(stderr, " run given programs parallel\n"); + fprintf(stderr, " startpar [options] [-P prev] [-R run] [-S :] -M mode\n"); + fprintf(stderr, " run parallel with Makefile\n"); + fprintf(stderr, " startpar -v\n"); + fprintf(stderr, " show version number\n"); + fprintf(stderr, "general options:\n"); + fprintf(stderr, " -p parallel tasks\n"); + fprintf(stderr, " -t I/O timeout\n"); + fprintf(stderr, " -T global I/O timeout\n"); + exit(status); +} + +int main(int argc, char **argv) +{ + int timo = -1; + int gtimo = -1; + int r, c, i, s, last, num; + int *resvec; + int maxfd; + fd_set rset; + struct timeval tv; + struct prg *p; + pid_t pid; + int forw = 0; + char pipebuf[16]; + int isgtimo; + struct prg *gtimo_running = 0; + struct prg *interactive_task = NULL; + int active, limit; + char *prev_level = NULL, *run_level = NULL; + char *splashopt = 0; + + numcpu = sysconf(_SC_NPROCESSORS_ONLN); + myname = argv[0]; + + while ((c = getopt(argc, argv, "fhp:t:T:a:M:P:R:S:v")) != EOF) + { + switch(c) + { + case 'p': + par = atoi(optarg); + break; + case 't': + timo = atoi(optarg); + break; + case 'T': + gtimo = atoi(optarg); + break; + case 'f': + forw = 1; + break; + case 'a': + arg = optarg; + break; + case 'M': + run_mode = optarg; + break; + case 'P': + prev_level = optarg; + break; + case 'R': + run_level = optarg; + break; + case 'S': + splashopt = optarg; + break; + case 'v': + printf("startpar version %s\n", VERSION); + exit(0); + case 'h': + usage(0); + break; + default: + usage(1); + break; + } + } + if (forw) + do_forward(); + argc -= optind; + argv += optind; + + if (splashopt) + { + char *so = strchr(splashopt, ':'); + if (!so) + splashopt = 0; + else + { + splashpos = atoi(splashopt); + splashopt = so + 1; + } + splashcfg = getenv("SPLASHCFG"); + if (!splashcfg) + { + splashpos = -1; + splashopt = 0; + } + } + if (run_mode) + { + char makefile[64]; + if (!strcmp(run_mode, "boot")) + arg = "start"; + else if (!strcmp(run_mode, "start") || !strcmp(run_mode, "stop")) + { + arg = run_mode; + if (!prev_level || !run_level) + { + fprintf(stderr, "You must specify previous and next runlevels\n"); + exit(1); + } + } + else + { + fprintf(stderr, "invalid run mode %s\n", run_mode); + exit(1); + } + snprintf(makefile, sizeof(makefile), "/etc/init.d/.depend.%s", run_mode); + parse_makefile(makefile); + check_run_files(run_mode, prev_level, run_level); + + argc = tree_entries; /* number of handled scripts */ + + if (argc == 0) + exit(0); + + if (par == 0) + par = 4; + if (par > argc) /* not more than the number of all scripts */ + par = argc; + + inpar = par; /* the original argument of parallel procs per cpu */ + + par = checkpar(inpar, run_mode); /* the number of parallel procs on all cpu's */ + + if (par > argc) /* not more than the number of all scripts */ + par = argc; + + nodevec = xcalloc(argc, sizeof(*nodevec)); + } + else + { + if (par < 0) + usage(1); + + if (argc == 0) + exit(0); + + if (par == 0) + par = argc; + if (par > argc) /* not more than the number of all scripts */ + par = argc; + + inpar = par; /* the original argument of parallel procs per cpu */ + + par = checkpar(inpar, "stop"); /* the number of parallel procs on all cpu's */ + + if (par > argc) /* not more than the number of all scripts */ + par = argc; + } + + num = 0; + resvec = (int *)xcalloc(argc, sizeof(int)); + for (i = 0; i < argc; i++) + resvec[i] = 255; + + if (argc == 1) + { + if (run_mode) { + *nodevec = pickup_task(); + if (*nodevec) { + *resvec = run_single((*nodevec)->name, calcsplash(0, 1, splashopt)); + finish_task(*nodevec); + } + } else + *resvec = run_single(*argv, calcsplash(0, 1, splashopt)); + goto finished; + } + + prgs = (struct prg *)xcalloc(par, sizeof *prgs); + gtimo_bufsize = par * PBUF_SIZE; + gtimo_buf = (char *) calloc(gtimo_bufsize, sizeof(char)); + if (!gtimo_buf) + gtimo_bufsize = 0; /* Accept error due memory shortage */ + + if (tcgetattr(0, &tio)) + { + perror("tcgetattr"); + exit(1); + } + if (ioctl(0, TIOCGWINSZ, &wz) == 0) + wzok = 1; + + if (pipe(pidpipe)) + { + perror("pipe"); + exit(1); + } + fcntl(pidpipe[0], F_SETFL, FNONBLOCK); + fcntl(pidpipe[1], F_SETFL, FNONBLOCK); + sa.sa_handler = sigchld; + sa.sa_flags = SA_RESTART; + (void)sigemptyset(&sa.sa_mask); + if (sigaction(SIGCHLD, &sa, 0)) + { + perror("sigchld sigaction"); + exit(1); + } + + gettimeofday(&glastio, 0); + limit = checklimit(inpar, (run_mode) ? run_mode : "stop"); + lastlim.tv_sec = glastio.tv_sec; + lastlim.tv_usec = glastio.tv_usec; + for (;;) + { + long diff; + + gettimeofday(&now, 0); + FD_ZERO(&rset); + tv.tv_sec = now.tv_sec; + tv.tv_usec = now.tv_usec; + last = -1; + maxfd = -1; + active = 0; + + diff = ((now.tv_sec - lastlim.tv_sec) * 1000) + + ((now.tv_usec - lastlim.tv_usec)/ 1000); + if (diff >= 300 || diff < 0) + { +#if DEBUG + fprintf(stderr, "%d: doing checklimit after %ldms %ld\n", getpid(), diff, time(0)); +#endif + limit = checklimit(inpar, (run_mode) ? run_mode : "stop"); + if (limit > argc) + limit = argc; /* not more than the number of all scripts */ + lastlim.tv_sec = now.tv_sec; + lastlim.tv_usec = now.tv_usec; + diff = 0; + } +#if DEBUG + fprintf(stderr, "par = %d, inpar = %d, limit = %d (diff=%ld)\n", par, inpar, limit, diff); +#endif + for (s = 0; s < par; s++) + { + p = prgs + s; + if (p == interactive_task) + continue; /* don't handle this here */ + if (p->fd || p->pid) + active++; /* count all running procs */ + if (p->fd == 0) + { + if (p->pid == 0 && num < argc && !interactive_task) + { + if (active >= limit) + break; /* load balancing */ + if (run_mode) + { + nodevec[num] = pickup_task(); + if (! nodevec[num]) + continue; + if (nodevec[num]->interactive) + interactive_task = p; + p->name = nodevec[num]->name; + } + else + p->name = *argv++; + p->splashadd = calcsplash(num, argc, splashopt); + p->num = num++; + if (interactive_task) + break; + run(p); + active++; /* remember this _new_ proc!!! */ + if (p->pid == 0) + { + resvec[p->num] = 1; + if (run_mode) + finish_task(nodevec[p->num]); + active--; /* fork in run() failed, sigh! */ + } + break; + } + continue; + } + FD_SET(p->fd, &rset); + if (p->fd > maxfd) + maxfd = p->fd; + if (p->len == 0) + continue; + if ((last < 0) || (tv.tv_sec > p->lastio.tv_sec) || + (tv.tv_sec == p->lastio.tv_sec && tv.tv_usec > p->lastio.tv_usec)) + { + last = s; + tv.tv_sec = p->lastio.tv_sec; + tv.tv_usec = p->lastio.tv_usec; + } + + } /* for (s = 0; s < par; s++) */ + + if (s < limit && num < argc) + continue; /* start new processes */ + + if (interactive_task) + { + if (active == 0) + { + p = interactive_task; + resvec[p->num] = run_single(p->name, p->splashadd); + if (run_mode) + finish_task(nodevec[p->num]); + p->pid = 0; + p->fd = 0; + interactive_task = NULL; + continue; + } + } + if (active == 0) + { + if (num < argc) + fprintf(stderr, "ERROR: not all processed (%d of %d)\n", num, argc); +#if DEBUG + if ((pid = waitpid(-1, &r, maxfd < 0 ? 0 : WNOHANG)) > 0) + fprintf(stderr, "ERROR: not all processes are checked\n"); +#endif + break; + } +#if 0 + fprintf(stderr, "active = %d\n", active); +#endif + if (active == 1 && last >= 0) + { + p = prgs + last; + writebuf(p); + continue; + } + + FD_SET(pidpipe[0], &rset); + /* drain the pidpipe */ + while ((r = read(pidpipe[0], pipebuf, sizeof pipebuf)) > 0) + ; + + pid = waitpid(-1, &r, maxfd < 0 ? 0 : WNOHANG); + if (pid > 0) + { + if (pid == splashpid) + splashpid = (pid_t)0; + for (s = 0; s < par; s++) + { + p = prgs + s; + if (p->pid == pid) + { + callsplash(p->splashadd, p->name, arg); + resvec[p->num] = WIFEXITED(r) ? WEXITSTATUS(r) : (WIFSIGNALED(r) ? 1 : 255); + if (run_mode) + finish_task(nodevec[p->num]); + p->pid = 0; + if (gtimo_running == p) + { + writebuf(p); + if (p->fd) + detach(p, GTIMO_OFFL); + flushbuf(); + gtimo_running = 0; + } + else if (gtimo_running) + { + storebuf(p); + if (p->fd) + detach(p, GTIMO_USED); + } + else + { + writebuf(p); + if (p->fd) + detach(p, GTIMO_OFFL); + } + break; + } + } + continue; + } + + if (maxfd < 0) + continue; /* start new processes? */ + + if (timo >= 0) + tv.tv_sec += timo; + + isgtimo = 0; + if (gtimo >= 0 && !gtimo_running && last >= 0 && prgs[last].pid) + { + const long glsec = glastio.tv_sec + gtimo; + if ((timo < 0) || (tv.tv_sec > glsec) || + (tv.tv_sec == glsec && tv.tv_usec > glastio.tv_usec)) + { + tv.tv_sec = glastio.tv_sec; + tv.tv_usec = glastio.tv_usec; + tv.tv_sec += gtimo; + isgtimo = 1; + } + } + + r = 0; + if (timo >= 0 || isgtimo) + { + int setfd = (pidpipe[0] > maxfd) ? pidpipe[0] : maxfd; + struct timeval wait; + + timersub(&tv, &now, &wait); + if (wait.tv_usec < 0) + { + wait.tv_usec += 1000000; + wait.tv_sec--; + } + if (wait.tv_sec >= 0) + { + int check = limit < par && num < argc; + + if (check) /* shorten timeout for new limit and procs ... */ + { + wait.tv_sec = 0; + wait.tv_usec = (300 - diff) * 1000; + } +#if DEBUG + fprintf(stderr, "going into select1 %d %ld %ld\n", last, wait.tv_sec, wait.tv_usec); +#endif + r = select(setfd + 1, &rset, 0, 0, (last >= 0 || check) ? &wait : 0); + + if (check && (r == 0)) /* ... but do not throw out messages to early!!! */ + continue; + } + else + { + wait.tv_sec = 0; /* Avoid looping around (does this ever happen?) */ + wait.tv_usec = 20*1000; + r = select(setfd + 1, &rset, 0, 0, last >= 0 ? &wait : 0); + } + } + else + { + int setfd = (pidpipe[0] > maxfd) ? pidpipe[0] : maxfd; + r = select(setfd + 1, &rset, 0, 0, 0); + } + + if (r == -1) + { + if (errno == EINTR) + continue; + perror("select"); + exit(1); + } + if (r == 0) + { + if (last < 0) /* just in case... */ + continue; + p = prgs + last; + writebuf(p); + if (isgtimo && p->pid) + gtimo_running = p; + } + else + { + for (s = 0; s < par; s++) + { + p = prgs + s; + if (p->fd == 0) + continue; + if (!FD_ISSET(p->fd, &rset)) + continue; + r = read(p->fd, p->buf + p->len, sizeof(p->buf) - p->len); + if (r <= 0) + { + if (!gtimo_running || p == gtimo_running) + writebuf(p); + close(p->fd); + p->fd = 0; + break; + } + p->len += r; + if (p->len == sizeof(p->buf)) + { + for (i = p->len - 1; i >= 0; i--) + { + if (p->buf[i] == '\n') + break; + } + if (++i <= 0) + i = p->len; + p->len = i; + writebuf(p); + p->len = i; /* writebuf clears p->len */ + if (p->len < sizeof(p->buf)) + memmove(p->buf, p->buf + p->len, sizeof(p->buf) - p->len); + p->len = sizeof(p->buf) - p->len; + } + p->lastio.tv_sec = now.tv_sec; + p->lastio.tv_usec = now.tv_usec; + } + } + } + + finished: + waitsplash(); + if (run_mode) + print_run_result(resvec, nodevec, run_mode); + else + { + for (i = 0; i < argc; i++) + { +#if DEBUG + if (resvec[i] == 255) + { + fprintf(stderr, "ERROR: forgotten process??\n"); + exit (1); + } +#endif + printf(i ? " %d" : "%d", resvec[i]); + } + printf("\n"); + } + return 0; +} --- sysvinit-2.86.ds1.orig/debian/startpar/makeboot.c +++ sysvinit-2.86.ds1/debian/startpar/makeboot.c @@ -0,0 +1,389 @@ +/* + * very very simple makefile parser + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "makeboot.h" + + +int tree_entries = 0; +struct makenode *tree_list = NULL; + +/* + * search for the node with the given name + * returns the node pointer or NULL if not found. + * + * FIXME: we should use hash for the effective search. + */ +static struct makenode *lookup_target(const char *name) +{ + struct makenode *t; + + for (t = tree_list; t; t = t->next) + if (! strcmp(t->name, name)) + return t; + return NULL; +} + +/* + * look for the node with the given name. if not exist, + * create a new one and append to the node list. + */ +static struct makenode *add_target(const char *name) +{ + struct makenode *node; + struct makenode *prev, *t; + + node = lookup_target(name); + if (node) + return node; + node = xcalloc(1, sizeof(*node)); + node->name = strdup(name); + if (! node->name) { + fprintf(stderr, "Can't malloc: %s\n", strerror(errno)); + exit(1); + } + + /* append to the list in alphabetical order */ + prev = NULL; + for (t = tree_list; t; prev = t, t = t->next) + if (strcmp(node->name, t->name) < 0) + break; + if (prev) + prev->next = node; + else + tree_list = node; + node->next = t; + tree_entries++; + return node; +} + +/* + * create a dependecy/selection node + */ +static struct makelist *new_list(struct makenode *node, struct makelist *next) +{ + struct makelist *x; + + x = xcalloc(1, sizeof(*x)); + x->node = node; + x->next = next; + return x; +} + +/* + * check whether the given target would create an infinte loop + */ +static int check_loop(struct makenode *dep, struct makenode *src) +{ + struct makelist *s; + for (s = dep->depend; s; s = s->next) { + if (s->node == src) { + fprintf(stderr, "loop exists %s in %s!\n", dep->name, src->name); + return 1; + } + if (check_loop(s->node, src)) + return 1; + } + return 0; +} + +/* + * add to the dependecy and selection lists + */ +static void add_depend(struct makenode *node, const char *dst) +{ + struct makenode *dep; + + dep = add_target(dst); + if (check_loop(dep, node)) + return; + dep->select = new_list(node, dep->select); + dep->num_sels++; + node->depend = new_list(dep, node->depend); + node->num_deps++; +} + +/* + * mark the selected service as an interactive task + * that should run solely + */ +static void mark_interactive(const char *name) +{ + struct makenode *node = lookup_target(name); + if (node) + node->interactive = 1; +} + + +#define DELIMITER " \t\r\n" + +/* + * parse (pseudo) makefile + * + * it may have only the following form: + * + * TARGETS = xxx ... + * INTERACTIVE = yyy ... + * aaa: + * bbb: xxx ddd ... + * + * other lines are ignored. + */ +void parse_makefile(const char *path) +{ + FILE *fp; + char buf[LINE_MAX]; /* FIXME: is this enough big? */ + char *s, *strp, *p; + struct makenode *node; + + if ((fp = fopen(path, "r")) == NULL) { + fprintf(stderr, "Can't open %s: %s\n", path, strerror(errno)); + exit(1); + } + + while (fgets(buf, sizeof(buf), fp)) { + for (s = buf; *s && isspace(*s); s++) + ; + if (! *s || *s == '#') + continue; + if (! strncmp(s, "TARGETS =", 9)) { + s += 9; + strp = s; + while ((s = strsep(&strp, DELIMITER))) { + if (! *s) + continue; + add_target(s); + } + } else if (! strncmp(s, "INTERACTIVE =", 13)) { + s += 13; + strp = s; + while ((s = strsep(&strp, DELIMITER))) { + if (! *s) + continue; + mark_interactive(s); + } + } else { + p = strchr(s, ':'); + if (! p) + continue; + *p = 0; + node = add_target(s); + strp = p + 1; + while ((s = strsep(&strp, DELIMITER))) { + if (! *s) + continue; + add_depend(node, s); + } + } + } + fclose(fp); +} + +/* + * filter out the list targets + */ + +static int filter_prefix; +static int dirfilter(const struct dirent *d) +{ + return *d->d_name == filter_prefix && + strlen(d->d_name) >= 4; /* to be sure */ +} + +static void filter_files(const char *dir, int prefix, int inverse) +{ + char path[64]; + int i, ndirs; + static struct dirent **dirlist; + struct makenode *t, *next; + + filter_prefix = prefix; + snprintf(path, sizeof(path), "/etc/init.d/%s.d", dir); + ndirs = scandir(path, &dirlist, dirfilter, alphasort); + /* mark all matching nodes */ + for (i = 0; i < ndirs; i++) { + t = lookup_target(dirlist[i]->d_name + 3); + if (t) + t->status = 1; + free(dirlist[i]); + } + free(dirlist); + /* deselect non-matching nodes */ + for (t = tree_list; t; t = next) { + next = t->next; + if ((! t->status && ! inverse) || (t->status && inverse)) { + /* remove from the list */ + struct makelist *x, *nx; + struct makenode *p; + for (x = t->select; x; x = nx) { + nx = x->next; + x->node->num_deps--; + free(x); + } + for (x = t->depend; x; x = nx) { + nx = x->next; + x->node->num_sels--; + free(x); + } + if (t == tree_list) + tree_list = next; + else { + for (p = tree_list; p->next != t; p = p->next) + ; + p->next = next; + } + /* don't free the node instance itself - it may be selected + * by others + */ + tree_entries--; + continue; + } + t->status = 0; + } +} + +/* + * mark the unnecessary services as finished. + * + * action is either boot, start or stop. + * prev and run are the previous and the next runlevel. + */ +void check_run_files(const char *action, const char *prev, const char *run) +{ + char buf[4] = "rc0"; + if (! strcmp(action, "boot")) { + filter_files("boot", 'S', 0); + } else if (! strcmp(action, "start")) { + buf[2] = *prev; + filter_files(buf, 'K', 1); + buf[2] = *run; + filter_files(buf, 'S', 0); + } else { + buf[2] = *prev; + filter_files(buf, 'K', 0); + buf[2] = *run; + filter_files(buf, 'S', 1); + } +} + + +/* + * call blogger + */ +#if 0 +static void blogger(char *fmt, ...) +{ + va_list ap; + char buf[128]; + int len; + + strcpy(buf, "blogger \""); + len = strlen(buf); + va_start(ap, fmt); + vsnprintf(buf + len, sizeof(buf) - len - 1, fmt, ap); + strcat(buf, "\""); + system(buf); + va_end(ap); +} +#else +# define blogger(arg...) +#endif + + +/* + * pick up the next running task + * return NULL if not found. + */ +struct makenode *pickup_task(void) +{ + struct makenode *node; + + for (node = tree_list; node; node = node->next) { + if (! node->status && ! node->num_deps) { + node->status = T_RUNNING; + blogger("service %s", node->name); + return node; + } + } + return NULL; +} + +/* + * finish the running task + */ +void finish_task(struct makenode *node) +{ + struct makelist *n; + + if (! node) + return; + for (n = node->select; n; n = n->next) + n->node->num_deps--; + node->status = T_FINISHED; + blogger("service %s done", node->name); +} + + +/* + * Print out the status that bash can run eval. + * The following things will be printed: + * failed services, skipped services and the current progress value. + */ +void print_run_result(int *resvec, struct makenode **nodevec, const char *action) +{ + int i, r, stop = (! strcmp(action, "stop")); + + printf("failed_service=\""); + i = r = 0; + for (i = 0; i < tree_entries; i++) { +#if DEBUG + if (resvec[i] == 255) { + fprintf(stderr, "ERROR: forgotten process??\n"); + exit(1); + } +#endif + if (resvec[i] >= 1 && resvec[i] <= 4) { + if (r) + printf(" "); + printf("%s", nodevec[i]->name); + r++; + } else if (!stop && resvec[i] == 7) { + if (r) + printf(" "); + printf("%s", nodevec[i]->name); + r++; + } + } + printf("\"\n"); + printf("skipped_service=\""); + i = r = 0; + for (i = 0; i < tree_entries; i++) { + if (resvec[i] == 5 || resvec[i] == 6) { + if (r) + printf(" "); + printf("%s", nodevec[i]->name); + r++; + } + } + printf("\"\n"); +} + +#if 0 +void dump_status(void) +{ + struct makenode *node; + + for (node = tree_list; node; node = node->next) + fprintf(stderr, "XXX %s: status = %d, dep = %d, int = %d\n", node->name, node->status, node->num_deps, node->interactive); +} +#endif --- sysvinit-2.86.ds1.orig/debian/startpar/proc.c +++ sysvinit-2.86.ds1/debian/startpar/proc.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2004 SuSE Linux AG + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (see the file COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + **************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "proc.h" + +static unsigned long int scan_one(const char* buff, const char *key) +{ + const char *b = strstr(buff, key); + unsigned long val = 0; + + if (!b) { + fprintf(stderr, "ERROR: no hit for %s\n", key); + return ~0UL; + } + if (sscanf(b + strlen(key), " %lu", &val) != 1) + return 0; + return val; +} + +int read_proc(unsigned long int * const prcs_run, unsigned long int * const prcs_blked) +{ + static char StatBuf[32*1024]; + unsigned long int running, blocked; + ssize_t n; + int fd; + + *prcs_run = 0; + *prcs_blked = 0; + + if ((fd = open( "/proc/stat", O_RDONLY )) < 0) { + fprintf(stderr, "ERROR: could not open /proc/stat: %s\n", strerror(errno)); + return 1; + } + + n = read( fd, StatBuf, (sizeof(StatBuf) - 1)); + close(fd); + if (n < 40) { + if (n < 0) { + fprintf(stderr, "ERROR: could not read /proc/stat: %s\n", strerror(errno)); + return 1; + } + fprintf(stderr, "ERROR: no enough data in /proc/stat?\n"); + return 1; + } + StatBuf[n] = 0; + + /* These fields are not present in /proc/stat for 2.4 kernels */ + running = scan_one(StatBuf, "procs_running"); + blocked = scan_one(StatBuf, "procs_blocked"); + + if (running == ~0UL || blocked == ~0UL) + return 1; + + *prcs_run = running; + *prcs_blked = blocked; + + return 0; +} --- sysvinit-2.86.ds1.orig/debian/startpar/startpar.8 +++ sysvinit-2.86.ds1/debian/startpar/startpar.8 @@ -0,0 +1,103 @@ +.\" +.\" SuSE man page for startpar +.\" Copyright (c) 2003 SuSE Linux AG, Nuernberg, Germany. +.\" please send bugfixes or comments to feedback@suse.de. +.\" +.\" Author: Michael Schroeder +.\" +.TH STARTPAR 8 "Jun 2003" +.SH NAME +startpar \- start runlevel scripts in parallel + +.SH SYNOPSIS +.B startpar +.RB [ -p +.IR par ] +.RB [ -t +.IR timeout ] +.RB [ -T +.IR global_timeout ] +.RB [ -a +.IR arg ] +.B prg1 +.B prg2 +.B ... +.br +.B startpar +.RB [ -p +.IR par ] +.RB [ -t +.IR timeout ] +.RB [ -T +.IR global_timeout ] +.B -M [ +.IR boot | start | stop ] + +.SH DESCRIPTION +startpar is used to run multiple run-level scripts in parallel. +The degree of parallelism on one +.B CPU +can be set with the +.B -p +option, the default is full parallelism. An argument to all of +the scripts can be provided with the +.B -a +option. + +The output of each script is buffered and written when the script +exits, so output lines of different scripts won't mix. You can +modify this behaviour by setting a timeout. + +The timeout set with the +.B -t +option is used as buffer timeout. If the output buffer of a +script is not empty and the last output was +.I timeout +seconds ago, startpar will flush the buffer. + +The +.B -T +option timeout works more globally. If no output is printed for +more than +.I global_timeout +seconds, startpar will flush the buffer of the script with +the oldest output. Afterwards it will only print output of this +script until it is finished. + +The +.B -M +option switches +.B startpar +into a +.BR make (1) +like behaviour. This option takes three different arguments: +.IR boot ", " start ", and " stop +for reading +.IR .depend.boot " or " .depend.start " or " .depend.stop +respectively in the directory +.IR /etc/init.d/ . +By scanning the boot and runlevel directories in +.I /etc/init.d/ +it then executes the appropriate scripts in parallel. + +.SH FILES +.I /etc/init.d/.depend.boot +.br +.I /etc/init.d/.depend.start +.br +.I /etc/init.d/.depend.stop + +.SH SEE ALSO +.BR init.d (7), +.BR insserv (8), +.BR startproc (8). + +.SH COPYRIGHT +2003,2004 SuSE Linux AG, Nuernberg, Germany. + +.SH AUTHOR +Michael Schroeder +.br +Takashi Iwai +.br +Werner Fink --- sysvinit-2.86.ds1.orig/debian/startpar/makeboot.h +++ sysvinit-2.86.ds1/debian/startpar/makeboot.h @@ -0,0 +1,42 @@ +/* + */ + +enum { + T_READY, T_RUNNING, T_FINISHED +}; + +/* target nodes */ +struct makenode { + char *name; + int num_deps; + struct makelist *depend; + int num_sels; + struct makelist *select; + int status; + struct makenode *next; + int interactive; +}; + +/* dependency and selection list nodes */ +struct makelist { + struct makenode *node; + struct makelist *next; +}; + +extern int tree_entries; +extern struct makenode *tree_list; +extern char *run_action; + +void parse_makefile(const char *path); +void check_run_files(const char *action, const char *prev, const char *run); + +struct makenode *pickup_task(void); +void finish_task(struct makenode *n); + +extern int do_splash; +extern int progress; +void init_splash(char *action); + +void *xcalloc(size_t nmemb, size_t size); + +void print_run_result(int *resvec, struct makenode **nodevec, const char *action); --- sysvinit-2.86.ds1.orig/debian/startpar/COPYING +++ sysvinit-2.86.ds1/debian/startpar/COPYING @@ -0,0 +1,341 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. --- sysvinit-2.86.ds1.orig/debian/startpar/proc.h +++ sysvinit-2.86.ds1/debian/startpar/proc.h @@ -0,0 +1,21 @@ +/* Copyright (c) 2004 SuSE Linux AG + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (see the file COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + **************************************************************** + */ + +int read_proc(unsigned long int *prcs_run, unsigned long int *prcs_blked); --- sysvinit-2.86.ds1.orig/debian/startpar/Makefile +++ sysvinit-2.86.ds1/debian/startpar/Makefile @@ -0,0 +1,28 @@ +VERSION = 0.49 + +INSTALL = install -m 755 +INSTALL_DATA = install -m 644 +DESTDIR = +sbindir = /sbin +mandir = /usr/share/man +man8dir = $(mandir)/man8 + +OBJS = startpar.o makeboot.o proc.o + +CC = gcc +OPTFLAGS = -O2 -g -Wall -W +CFLAGS = $(OPTFLAGS) -D_GNU_SOURCE + +.c.o: + $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c $< + +startpar: $(OBJS) + $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -o $@ $(OBJS) + +install: startpar + $(INSTALL) -d $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir) + $(INSTALL) -s startpar $(DESTDIR)$(sbindir)/. + $(INSTALL_DATA) startpar.8 $(DESTDIR)$(man8dir)/. + +clean: + rm -f startpar $(OBJS) --- sysvinit-2.86.ds1.orig/debian/startpar/README +++ sysvinit-2.86.ds1/debian/startpar/README @@ -0,0 +1,8 @@ +This program was found in the SuSe source rpm of sysvinit. + +I started with +, +converted it to tgz using alien, unpacked the tarball and applied all the +patches listed in the spec file. + +Petter Reinholdtsen, 2005-09-10 --- sysvinit-2.86.ds1.orig/debian/share/inittab.gnu +++ sysvinit-2.86.ds1/debian/share/inittab.gnu @@ -0,0 +1,69 @@ +# /etc/inittab: init(8) configuration. +# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ + +# The default runlevel. +id:2:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin + +# What to do when CTRL-ALT-DEL is pressed. +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +# Action on special keypress (ALT-UpArrow). +#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work." + +# What to do when the power fails/returns. +pf::powerwait:/etc/init.d/powerfail start +pn::powerfailnow:/etc/init.d/powerfail now +po::powerokwait:/etc/init.d/powerfail stop + +# /libexec/getty invocations for the runlevels. +# +# The "id" field MUST be the same as the last +# characters of the device (after "tty"). +# +# Format: +# ::: +# +# Note that on most Debian systems tty7 is used by the X Window System, +# so if you want to add more getty's go ahead but skip tty7 if you run X. +# +1:2345:respawn:/libexec/getty 38400 tty1 +2:23:respawn:/libexec/getty 38400 tty2 +3:23:respawn:/libexec/getty 38400 tty3 +4:23:respawn:/libexec/getty 38400 tty4 +5:23:respawn:/libexec/getty 38400 tty5 +6:23:respawn:/libexec/getty 38400 tty6 + +# Example how to put a getty on a serial line (for a terminal) +# +#T0:23:respawn:/libexec/getty -L ttyS0 9600 vt100 +#T1:23:respawn:/libexec/getty -L ttyS1 9600 vt100 + +# Example how to put a getty on a modem line. +# +#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3 + --- sysvinit-2.86.ds1.orig/debian/share/update-rc.d +++ sysvinit-2.86.ds1/debian/share/update-rc.d @@ -0,0 +1,27 @@ +#! /bin/sh +# +# update-rc.d +# +# Dummy update-rc.d, installed when file-rc replaces +# sysv-rc or the other way around. The postrm of the +# package being replaced symlinks /usr/sbin/update-rc.d +# to this dummy file. +# +# All this script does is "scream and die". +# + +name=`basename $0` + +cat <&2 + +$name: not present yet. + +You are replacing sysv-rc with file-rc or another -rc package, or +the other way around. The replacement package must first be +unpacked before you can configure other packages. + +Exiting with error status 1. + +EOF + +exit 1 --- sysvinit-2.86.ds1.orig/debian/share/inittab.kfreebsd-gnu +++ sysvinit-2.86.ds1/debian/share/inittab.kfreebsd-gnu @@ -0,0 +1,69 @@ +# /etc/inittab: init(8) configuration. +# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ + +# The default runlevel. +id:2:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin + +# What to do when CTRL-ALT-DEL is pressed. +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +# Action on special keypress (ALT-UpArrow). +#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work." + +# What to do when the power fails/returns. +pf::powerwait:/etc/init.d/powerfail start +pn::powerfailnow:/etc/init.d/powerfail now +po::powerokwait:/etc/init.d/powerfail stop + +# /sbin/getty invocations for the runlevels. +# +# The "id" field MUST be the same as the last +# characters of the device (after "tty"). +# +# Format: +# ::: +# +# Note that on most Debian systems ttyv6 is used by the X Window System, +# so if you want to add more getty's go ahead but skip ttyv6 if you run X. +# +1:2345:respawn:/sbin/getty 38400 ttyv0 cons25 +2:23:respawn:/sbin/getty 38400 ttyv1 cons25 +3:23:respawn:/sbin/getty 38400 ttyv2 cons25 +4:23:respawn:/sbin/getty 38400 ttyv3 cons25 +5:23:respawn:/sbin/getty 38400 ttyv4 cons25 +6:23:respawn:/sbin/getty 38400 ttyv5 cons25 + +# Example how to put a getty on a serial line (for a terminal) +# +#T0:23:respawn:/sbin/getty -L cuaa0 9600 vt100 +#T1:23:respawn:/sbin/getty -L cuaa1 9600 vt100 + +# Example how to put a getty on a modem line. +# +#T3:23:respawn:/sbin/mgetty -x0 -s 57600 cuaa3 + --- sysvinit-2.86.ds1.orig/debian/share/inittab +++ sysvinit-2.86.ds1/debian/share/inittab @@ -0,0 +1,69 @@ +# /etc/inittab: init(8) configuration. +# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ + +# The default runlevel. +id:2:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin + +# What to do when CTRL-ALT-DEL is pressed. +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +# Action on special keypress (ALT-UpArrow). +#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work." + +# What to do when the power fails/returns. +pf::powerwait:/etc/init.d/powerfail start +pn::powerfailnow:/etc/init.d/powerfail now +po::powerokwait:/etc/init.d/powerfail stop + +# /sbin/getty invocations for the runlevels. +# +# The "id" field MUST be the same as the last +# characters of the device (after "tty"). +# +# Format: +# ::: +# +# Note that on most Debian systems tty7 is used by the X Window System, +# so if you want to add more getty's go ahead but skip tty7 if you run X. +# +1:2345:respawn:/sbin/getty 38400 tty1 +2:23:respawn:/sbin/getty 38400 tty2 +3:23:respawn:/sbin/getty 38400 tty3 +4:23:respawn:/sbin/getty 38400 tty4 +5:23:respawn:/sbin/getty 38400 tty5 +6:23:respawn:/sbin/getty 38400 tty6 + +# Example how to put a getty on a serial line (for a terminal) +# +#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 +#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 + +# Example how to put a getty on a modem line. +# +#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3 + --- sysvinit-2.86.ds1.orig/debian/share/inittab.knetbsd-gnu +++ sysvinit-2.86.ds1/debian/share/inittab.knetbsd-gnu @@ -0,0 +1,67 @@ +# /etc/inittab: init(8) configuration. +# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ + +# The default runlevel. +id:2:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin + +# What to do when CTRL-ALT-DEL is pressed. +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +# Action on special keypress (ALT-UpArrow). +#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work." + +# What to do when the power fails/returns. +pf::powerwait:/etc/init.d/powerfail start +pn::powerfailnow:/etc/init.d/powerfail now +po::powerokwait:/etc/init.d/powerfail stop + +# /sbin/getty invocations for the runlevels. +# +# The "id" field MUST be the same as the last +# characters of the device (after "tty"). +# +# Format: +# ::: +# +# Note that on most Debian systems tty7 is used by the X Window System, +# so if you want to add more getty's go ahead but skip tty7 if you run X. +# +1:2345:respawn:/sbin/getty 38400 ttyE0 +2:23:respawn:/sbin/getty 38400 ttyE1 +3:23:respawn:/sbin/getty 38400 ttyE2 +4:23:respawn:/sbin/getty 38400 ttyE3 + +# Example how to put a getty on a serial line (for a terminal) +# +#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 +#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 + +# Example how to put a getty on a modem line. +# +#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3 + --- sysvinit-2.86.ds1.orig/debian/share/inittab.s390-linux-gnu +++ sysvinit-2.86.ds1/debian/share/inittab.s390-linux-gnu @@ -0,0 +1,63 @@ +# /etc/inittab: init(8) configuration. +# $Id: inittab.s390,v 1.9 2000/01/10 10:15:30 miquels Exp $ + +# The default runlevel. +id:2:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin + +# What to do when CTRL-ALT-DEL is pressed. +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +# Action on special keypress (ALT-UpArrow). +kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work." + +# What to do when the power fails/returns. +pf::powerwait:/etc/init.d/powerfail start +pn::powerfailnow:/etc/init.d/powerfail now +po::powerokwait:/etc/init.d/powerfail stop + +# /sbin/getty invocations for the runlevels. +# +# The "id" field MUST be the same as the last +# characters of the device (after "tty"). +# +# Format: +# ::: +# +# The s390 only has a dumb terminal on /dev/console. +# +1:2345:respawn:/sbin/getty 38400 console dumb + +# Example how to put a getty on a serial line (for a terminal) +# +#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 +#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 + +# Example how to put a getty on a modem line. +# +#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3 + --- sysvinit-2.86.ds1.orig/debian/sysv-rc/saveconfig +++ sysvinit-2.86.ds1/debian/sysv-rc/saveconfig @@ -0,0 +1,65 @@ +#! /usr/bin/perl +# +# saveconfig +# +# Print out the configuration of the current /etc/rc?.d +# symlink setup, in a format compatible to the +# "update-rc.d" command line. +# +# Author: Miquel van Smoorenburg +# + +chdir "/etc/init.d"; + +sub scan { + my $dir = shift; + local *DD; + my $f; + opendir DD, $dir; + foreach $f (readdir DD) { + next if ($f =~ m/^\./); + push @{$dir{$dir}}, $f; + } + closedir DD; +} + +foreach my $d (qw(S 0 1 2 3 4 5 6 7 8 9)) { + scan("/etc/rc$d.d"); +} +scan("/etc/init.d"); + +foreach my $s (@{$dir{"/etc/init.d"}}) { + my %start; + my %stop; + my $start = 0; + my $stop = 0; + foreach my $l (qw(S 0 1 2 3 4 5 6)) { + #print "L: $l\n"; + foreach my $f (@{$dir{"/etc/rc$l.d"}}) { + #print "F: $f\n"; + if ($f =~ m#^S(\d+)$s$#) { + $start{$1} .= "$l "; + $start = 1; + } + if ($f =~ m#^K(\d+)$s$#) { + $stop{$1} .= "$l "; + $stop = 1; + } + } + } + + print "$s " if ($start || $stop); + if ($start > 0) { + print "start "; + foreach my $x (sort keys %start) { + print "$x ", $start{$x}, ". "; + } + } + if ($stop > 0) { + print "stop "; + foreach my $x (sort keys %stop) { + print "$x ", $stop{$x}, ". "; + } + } + print "\n" if ($start || $stop); +} --- sysvinit-2.86.ds1.orig/debian/sysv-rc/postinst +++ sysvinit-2.86.ds1/debian/sysv-rc/postinst @@ -0,0 +1,17 @@ +#! /bin/sh +# +# sysv-rc postinst +# + +case "$1" in + configure) + oldver=$2 + ;; + abort-upgrade|abort-remove|abort-deconfigure) + exit 0 + ;; +esac + +umask 022 + +exit 0 --- sysvinit-2.86.ds1.orig/debian/sysv-rc/postrm +++ sysvinit-2.86.ds1/debian/sysv-rc/postrm @@ -0,0 +1,18 @@ +#! /bin/sh +# +# sysv-rc postrm +# + +set -e + +case "$1" in + remove) : ;; + *) exit 0 ;; +esac + +umask 022 + +ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/update-rc.d +ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/invoke-rc.d + +exit 0 --- sysvinit-2.86.ds1.orig/debian/sysv-rc/copyright +++ sysvinit-2.86.ds1/debian/sysv-rc/copyright @@ -0,0 +1,32 @@ +This package contains the mechanism for executing the right scripts +in the right order at bootup/shutdown time, and when changing runlevels. +It works through managing symlinks in /etc/rc?.d + +This package is built from the `sysvinit' source package. Please +consult the copyright file of the sysvinit package for the location of +the upstream sources of the sysvinit package. Debian-specific files +for sysvinit, such as these initscripts, are maintained by the members +of the pkg-sysvinit project at alioth.debian.org. + + http://alioth.debian.org/projects/pkg-sysvinit + +Copyright 1997-2005 Miquel van Smoorenburg and +the members pkg-sysvinit project. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/linda.overrides +++ sysvinit-2.86.ds1/debian/sysv-rc/linda.overrides @@ -0,0 +1,5 @@ +Tag: bad-perms-for-initd +Data: etc/init.d/README + +Tag: etc-conffile +Data: .*README.* --- sysvinit-2.86.ds1.orig/debian/sysv-rc/rc2-5.d-README +++ sysvinit-2.86.ds1/debian/sysv-rc/rc2-5.d-README @@ -0,0 +1,13 @@ +The scripts in this directory are executed each time the system enters +this runlevel. + +The scripts are all symbolic links whose targets are located in +/etc/init.d/ . + +To disable a service in this runlevel, rename its script in this directory +so that the new name begins with a 'K' and a two-digit number, where the +number is the difference between the two-digit number following the 'S' +in its current name, and 100. To re-enable the service, rename the script +back to its original name beginning with 'S'. + +For a more information see /etc/init.d/README. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/lintian.overrides +++ sysvinit-2.86.ds1/debian/sysv-rc/lintian.overrides @@ -0,0 +1,25 @@ +sysv-rc: package-installs-into-etc-rc.d etc/rcS.d/README +sysv-rc: package-installs-into-etc-rc.d etc/rc0.d/README +sysv-rc: package-installs-into-etc-rc.d etc/rc1.d/README +sysv-rc: package-installs-into-etc-rc.d etc/rc2.d/README +sysv-rc: package-installs-into-etc-rc.d etc/rc3.d/README +sysv-rc: package-installs-into-etc-rc.d etc/rc4.d/README +sysv-rc: package-installs-into-etc-rc.d etc/rc5.d/README +sysv-rc: package-installs-into-etc-rc.d etc/rc6.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rcS.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rc0.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rc1.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rc2.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rc3.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rc4.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rc5.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/rc6.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/init.d/README +sysv-rc: file-in-etc-not-marked-as-conffile /etc/init.d/rc +sysv-rc: file-in-etc-not-marked-as-conffile /etc/init.d/rcS +sysv-rc: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/README +sysv-rc: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/rc +sysv-rc: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/rcS +sysv-rc: non-standard-file-permissions-for-etc-init.d-script etc/init.d/README 0644 != 0755 +sysv-rc: postrm-contains-additional-updaterc.d-calls /etc/init.d//usr/sbin/update-rc.d +sysv-rc: postrm-contains-additional-updaterc.d-calls /etc/init.d//usr/sbin/invoke-rc.d --- sysvinit-2.86.ds1.orig/debian/sysv-rc/man5/rc.boot.5 +++ sysvinit-2.86.ds1/debian/sysv-rc/man5/rc.boot.5 @@ -0,0 +1,14 @@ +.TH RC.BOOT 5 "December 26, 1997" "" "Debian GNU/Linux Manual" +.SH NAME +/etc/rc.boot \- directory for local or per-package boot scripts. +.SH DESCRIPTION +The /etc/rc.boot directory is obsolete. It has been superseded by the +/etc/rcS.d directory. At boot time, first the /etc/rcS.d directory is scanned +and then, for backwards compatibility, the /etc/rc.boot directory. +.PP +The directory \fI/etc/rc.boot\fP is scanned by the program +\fBrun-parts\fP(8). The scripts found that have valid filenames for +the \fBrun-parts\fP program will be run in lexical sort order of the +filenames. +.SH "SEE ALSO" +run-parts(8), init(1). --- sysvinit-2.86.ds1.orig/debian/sysv-rc/man8/invoke-rc.d.8 +++ sysvinit-2.86.ds1/debian/sysv-rc/man8/invoke-rc.d.8 @@ -0,0 +1,224 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Authors: Henrique Holschuh +.TH INVOKE\-RC.D 8 "1 March 2001" "Debian Project" "Debian/GNU Linux" +.SH NAME +invoke\-rc.d \- executes System-V style init script actions +.SH SYNOPSIS +.B invoke\-rc.d +.RI [ --quiet ] +.RI [ --force ] +.RI [ --try-anyway ] +.RI [ --disclose-deny ] +.RI [ --query ] +.RI [ --no-fallback ] +.I name +.I action +.RI [ init\ script\ parameters... ] +.HP +.B invoke\-rc.d +.RI [ --help ] +.HP +.SH DESCRIPTION +.B invoke\-rc.d +is a generic interface to execute System V style init script +.BI /etc/init.d/ name \fR +actions, obeying runlevel constraints as well as any local +policies set by the system administrator. + +All access to the init scripts by Debian packages' maintainer +scripts should be done through +.B invoke\-rc.d\fR. + +This manpage documents only the usage and behavior of +.BR invoke\-rc.d . +For a discussion of the System V style init script arrangements please +see +.BR init (8) +and the +.IR "dpkg Programmers' Manual" . +More information on invoke-rc.d can be found in the section on +runlevels and init.d scripts of the +.IR "Debian Policy Manual" . + +.SH INIT SCRIPT ACTIONS +The standard actions are: +.IR start , +.IR stop , +.IR force\-stop , +.IR restart , +.IR reload , +.IR force\-reload , +and +.IR status . +Other actions are accepted, but they can cause problems to +.B policy\-rc.d +(see the +.B INIT SCRIPT POLICY +section), so warnings are generated if the policy layer +is active. + +Please note that not all init scripts will implement all +the actions listed above, and that the policy layer may +override an action to another action(s), or even deny it. + +Any extra parameters will be passed to the init script(s) being +executed. + +If an action must be carried out regardless of any local +policies, use the +.IR --force +switch. + +.SH OPTIONS +.TP +.I --help +Display usage help. +.TP +.I --quiet +Quiet mode, no error messages are generated. +.TP +.I --force +Tries to run the init script regardless of policy and +init script subsystem errors. +.B Use of this option in Debian maintainer scripts is severely discouraged. +.TP +.I --try-anyway +Tries to run the init script if a non-fatal error is +detected. +.TP +.I --disclose-deny +Return status code 101 instead of status code 0 if +the init script action is denied by the policy layer. +.TP +.I --query +Returns one of the status codes 100-106. Does not +run the init script, and implies +.IR --disclose-deny +and +.IR --no-fallback . +.TP +.I --no-fallback +Ignores any fallback action requests by the policy +layer. +.B Warning: +this is usually a very bad idea for any actions other +than +.RI start . +.SH STATUS CODES +Should an init script be executed, +.B invoke\-rc.d +always returns the status code +returned by the init script. Init scripts should not return status codes in +the 100+ range (which is reserved in Debian and by the LSB). The status codes +returned by invoke\-rc.d proper are: +.TP +0 +.IR Success . +Either the init script was run and returned exit status 0 (note +that a fallback action may have been run instead of the one given in the +command line), or it was not run because of runlevel/local policy constrains +and +.B --disclose-deny +is not in effect. +.TP +1 - 99 +Reserved for init.d script, usually indicates a failure. +.TP +100 +.B Init script ID +.BI ( name ) +.BR unknown . +This means the init script was not registered successfully through +.B update\-rc.d +or that the init script does not exist. +.TP +101 +.B Action not allowed\fR. +The requested action will not be performed because of runlevel or local +policy constraints. +.TP +102 +.B Subsystem error\fR. +Init script (or policy layer) subsystem malfunction. Also, forced +init script execution due to +.I --try-anyway +or +.I --force +failed\fR. +.TP +103 +.I Syntax error\fR. +.TP +104 +.I Action allowed\fR. +Init script would be run, but +.B --query +is in effect. +.TP +105 +.I Behavior uncertain\fR. +It cannot be determined if action should be carried out or not, and +.B --query +is in effect. +.TP +106 +.I Fallback action requested\fR. +The policy layer denied the requested action, and +supplied an allowed fallback action to be used instead. + +.SH INIT SCRIPT POLICY +.B invoke\-rc.d +introduces the concept of a policy layer which is used to verify if +an init script should be run or not, or if something else should be +done instead. This layer has various uses, the most immediate ones +being avoiding that package upgrades start daemons out-of-runlevel, +and that a package starts or stops daemons while inside a chroot +jail. + +The policy layer has the following abilities: deny or approve the +execution of an action; request that another action (called a +.IR fallback ) +is to be taken, instead of the action requested in invoke\-rc.d's +command line; or request multiple actions to be tried in order, until +one of them succeeds (a multiple +.IR fallback ). + +.B invoke\-rc.d +itself only pays attention to the current runlevel; it will block +any attempts to start a service in a runlevel in which the service is +disabled. Other policies are implemented with the use of the +.B policy\-rc.d +helper, and are only available if +.B /usr/sbin/policy\-rc.d +is installed in the system. + +.SH FILES +.TP +.BR /etc/init.d/* +System V init scripts. +.TP +.BR /usr/sbin/policy\-rc.d +Init script policy layer helper (not required). +.TP +.BR /etc/runlevel.conf +file-rc runlevel configuration (if the file-rc package is +being used). +.TP +.BR /etc/rc?.d/* +System V runlevel configuration (if the sysv-rc package is +not being used). + +.SH BUGS +Please report any bugs using the Debian bug tracking system, +http://bugs.debian.org/, packages sysv\-rc or file\-rc +(depending on which version of invoke\-rc.d you are using). +.SH SEE ALSO +.IR "dpkg Programmers' manual" , +.br +.BR /etc/init.d/skeleton , +.br +.BR update\-rc.d (8), +.br +.BR init (8), +.br +.BR /usr/share/doc/sysv-rc/README.policy-rc.d --- sysvinit-2.86.ds1.orig/debian/sysv-rc/man8/update-rc.d.8 +++ sysvinit-2.86.ds1/debian/sysv-rc/man8/update-rc.d.8 @@ -0,0 +1,295 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Authors: Ian Jackson, Miquel van Smoorenburg +.TH UPDATE\-RC.D 8 "14 November 2005" "Debian Project" "sysv-rc" +.SH NAME +update\-rc.d \- install and remove System-V style init script links +.SH SYNOPSIS +.B update\-rc.d +.RI [ -n ] +.RI [ -f ] +.IB name " remove" +.HP +.B update-rc.d +.RI [ -n ] +.IB name +.BR defaults | multiuser +.RI [ NN " | " SS " " KK ] +.HP +.B update-rc.d +.RI [ -n ] +.I name +.BR start | stop +.IR "NN runlevel" " [" runlevel "]..." +.B . +.BR start | stop +.IR "NN runlevel" " [" runlevel "]..." +.BR . " ..." +.SH DESCRIPTION +.B update-rc.d +updates the System V style init script links +.BI /etc/rc runlevel .d/ NNname +whose target is the script +.BI /etc/init.d/ name \fR. +These links are run by +.B init +when it changes runlevels; they are generally used to start and stop +system services such as daemons. +.I runlevel +is one of the runlevels supported by +.BR init ", namely, " 0123456789S ", and " +.I NN +is the two-digit sequence number that determines where in the sequence +.B init +will run the scripts. + +This manpage documents only the usage and behaviour of +.BR update-rc.d . +For a discussion of the System V style init script arrangements please +see +.BR init (8) +and the +.IR "Debian Policy Manual" . +.P +Please note that this program was designed for use +in package maintainer scripts and, accordingly, +has only the very limited functionality required by such scripts. +System administrators are not encouraged to use +.BR update-rc.d +to manage runlevels. +They should edit the links directly or +use runlevel editors such as +.B sysv-rc-conf +and +.B bum +instead. +.SH INSTALLING INIT SCRIPT LINKS +When run with either the +.BR defaults ", " multiuser ", " start ", or " stop +options, +.B update-rc.d +makes links +.BI /etc/rc runlevel .d/[SK] NNname +that point to the script +.BR /etc/init.d/ \fIname\fR. + +If any files +.BI /etc/rc runlevel .d/[SK]?? name +already exist then +.B update-rc.d +does nothing. +The program was written this way so that it will never +change an existing configuration, which may have been +customized by the system administrator. +The program will only install links if none are present, +i.e., +if it appears that the service has never been installed before. +.P +A common system administration error is to delete the links +with the thought that this will "disable" the service, i.e., +that this will prevent the service from being started. +However, if all links have been deleted then the next time +the package is upgraded, the package's +.I postinst +script will run +.B update-rc.d +again and this will reinstall links at their factory default locations. +The correct way to disable services is to configure the +service as stopped in all runlevels in which it is started by default. +In the System V init system this means renaming +the service's symbolic links +from +.B S +to +.BR K . +.P +If +.B defaults +is used then +.B update-rc.d +will make links to start the service in runlevels +.B 2345 +and to stop the service in runlevels +.BR 016 . +If +.B multiuser +is used then +.B update-rc.d +will make links to start the service in runlevels +.B 2345 +and top stop the service in only runlevel +.BR 1 . +By default all the links will have sequence number 20, but +this can be overridden by supplying one +.I NN +or two +.I SS +and +.I KK +arguments to either +.BR defaults " or " multiuser ; +a single argument overrides the sequence number +for both start and stop links +whereas a pair of arguments overrides the sequence numbers +for start and stop links, respectively. +.P +As a rule of thumb, the sequence number of the stop link +should 100 minus the sequence number of the start link; +this causes services to be stopped in the opposite order +to that in which they are started. +Obviously, therefore, the default stop sequence number +should be 80. +Defaulting to 20, as +.B update-rc.d +does, is an old bug that cannot be fixed because +of the risk of breaking things. +.P +Instead of +.BR defaults " or " multiuser +one can give one or more sets of arguments specifying +particular runlevels in which to start or stop the service. +Each of these sets of arguments starts with the keyword +.BR start " or " stop +and a sequence number +.IR NN , +followed by one or more runlevel numbers. +The set is terminated by a solitary full stop character. +When explicit specification, rather than +.BR defaults , +is used there will usually be one +.B start +and one +.B stop +set. If different sequence codes are required in different runlevels +then several +.B start +sets or several +.B stop +sets may be specified. +If this is done and the same runlevel is named in multiple sets +then only the last one counts. +Therefore it is not possible to create multiple +.B start +or multiple +.B stop +links for a service in a single runlevel directory. +.P +The script +.BI /etc/init.d/ name +must exist before +.B update-rc.d +is run to create the links. +.SH REMOVING SCRIPTS +When invoked with the +.I remove +option, update-rc.d removes any links in the +.BI /etc/rc runlevel .d +directories to the script +.BI /etc/init.d/ name\fR. +The script must have been deleted already. +If the script is still present then +.B update-rc.d +aborts with an error message. +.P +.B update-rc.d +is usually called from a package's post-removal script when that +script is given the +.B purge +argument. +Any files in the +.BI /etc/rc runlevel .d +directories that are not symbolic links to the script +.BI /etc/init.d/ name +will be left untouched. + +.SH OPTIONS +.TP +.I -n +Don't do anything, just show what we would do. +.TP +.I -f +Force removal of symlinks even if +.BI /etc/init.d/ name +still exists. +.SH EXAMPLES +Insert links using the defaults: +.nf +.B " update-rc.d foobar defaults" +.fi +Equivalent command using explicit argument sets: +.nf +.B " update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ." +.fi +Insert links for a service that should be running during multi-user mode, +but that does not need to be explicitly stopped on shutdown: +.nf +.B " update-rc.d foobar multiuser" +.fi +Equivalent command using explicit argument sets: +.nf +.B " update-rc.d foobar start 20 2 3 4 5 . stop 20 1 ." +.fi +More typical command using explicit argument sets: +.nf +.B " update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 ." +.fi +Remove all links for a script (assuming foobar has been deleted +already): +.nf +.B " update-rc.d foobar remove" +.fi +Example of disabling a service: +.nf +.B " update-rc.d -f foobar remove" +.B " update-rc.d foobar stop 20 2 3 4 5 ." +.fi +Example of a command for installing a system initialization-and-shutdown script: +.nf +.B " update-rc.d foobar start 45 S . start 31 0 6 ." +.fi +Example of a command for disabling a system initialization-and-shutdown script: +.nf +.B " update-rc.d -f foobar remove" +.B " update-rc.d foobar stop 45 S ." +.fi + +.SH NOTES +The +.B multiuser +option is an Ubuntu-extension intended to reduce the amount of time spent +stopping services during shutdown and reboot that have no particular +requirement to be explicitly stopped. + +Unless your init script does something in the +.B stop +command that is more than just sending the +.BR TERM " or " KILL +signal to the running process, you should strongly consider using +.B multiuser +instead of +.BR defaults . + +.SH BUGS +See http://bugs.debian.org/sysv-rc. +.SH FILES +.TP +.B /etc/init.d/ +The directory containing the actual init scripts. +.TP +.B /etc/rc?.d/ +The directories containing the links used by +.BR init +and managed by +.BR update-rc.d . +.TP +.B /etc/init.d/skeleton +Model for use by writers of +.B init.d +scripts. +.SH SEE ALSO +.IR "Debian Policy Manual" , +.br +.BR /etc/init.d/skeleton , +.br +.BR sysv-rc-conf (8), +.BR bum (8), +.BR init (8). --- sysvinit-2.86.ds1.orig/debian/sysv-rc/man8/es/update-rc.d.8 +++ sysvinit-2.86.ds1/debian/sysv-rc/man8/es/update-rc.d.8 @@ -0,0 +1,206 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Authors: Ian Jackson +.\" (c) 2003 Software in the Public Interest + +.\" Traductor: Rubén Porras (nahoo@inicia.es) +.\" Revisado por : Javier Fernández-Sanguino Peña (jfs@debian.org) +.\" Esteban Manchado Velázquez (zoso@demiurgo.org) +.\" Está basada en la página de manual original: +.\" versión 1.2 del CVS de /cvs/debian-doc/manpages/english/sysvinit/update-rc.d.8 + +.TH UPDATE\-RC.D 8 "23 de Diciembre de 2003" "Proyecto Debian" "sysv-rc" +.SH NOMBRE +update\-rc.d \- crea y borra los enlaces a los scripts init de tipo +System V +.SH SINOPSIS +.B update\-rc.d +.RI [ -n ] +.RI [ -f ] +.IB nombre " remove" +.HP +.B update-rc.d +.RI [ -n ] +.IB nombre " defaults" +.RI [ NN " | " NN-start " " NN-stop ] +.HP +.B update-rc.d +.RI [ -n ] +.I nombre +.BR start | stop +.IR "NN nivel_de_ejecución nivel_de_ejecución " ... +.B . +.BR start | stop +.IR "NN nivel_de_ejecución nivel_de_ejecución " ... +.BR . " ..." +.SH DESCRIPCIÓN +.B update-rc.d +actualiza automáticamente los enlaces a los scripts de init tipo +System V que se encuentran en +.BI /etc/rc[nivel_de_ejecución].d/NNnombre +y que apuntan a los script +.BI /etc/init.d/nombre\fR. +Estos son ejecutados por +.B init +cuando se cambia de nivel de ejecución y se usan generalmente para +arrancar y parar servicios del sistema (por ejemplo, demonios). +.I nivel_de_ejecución +es uno de los soportados por +.BR init ", " 0123456789S , +y +.I NN +es el código de secuencia de dos dígitos usado por +.B init +para decidir en que orden se ejecutan los scripts. + +Esta página del manual documenta sólo el modo de uso y comportamiento de +.BR update-rc.d . +Para una explicación más detallada sobre la administración de los +scripts de init estilo System V, por favor, lea +.BR init (8) +y el +.IR "Manual de normativa de Debian" . +.SH CREACIÓN DE ENLACES A LOS SCRIPTS DE INIT +Cuando se ejecuta con una o varias de las opciones +.BR defaults ", " start ", o " stop , +.B update-rc.d +crea los enlaces +.BI /etc/rc[nivel_de_ejecución].d/[SK]NNnombre +apuntando al script +.BI /etc/init.d/nombre\fR. + +Si ya existe algún fichero con el nombre +.BI /etc/rc[nivel_de_ejecución].d/[SK]?? +entonces +.B update-rc.d +no hace nada. Esto es así para que el administrador del sistema pueda +reorganizar los enlaces ( teniendo en cuenta que debe dejar al +menos un enlace si los quiere eliminar ) sin que se sobreescriba su +configuración. + +Si se usa la opción +.B defaults +entonces +.B update-rc.d +creará enlaces para arrancar los servicios en los niveles de ejecución +.B 2345 +y parar los servicios en los niveles de ejecución +.BR 016 . +Por omisión todos los enlaces tendrán el código de secuencia 20, pero +esto puede cambiarse especificando uno o dos argumentos +.I NN. +Un argumento cambia el valor por omisión del código de secuencia tanto +para los enlaces de arranque como para los de parada, y si se +proporcionan dos argumentos el primero cambia el código de los enlaces +de arranque y el segundo el de los enlaces de parada. + +En vez de usar +.B defaults +, los niveles de ejecución en los que se arranca o se para un servicio +pueden ser especificados explícitamente mediante un conjunto de +argumentos: + +Cada uno de estos conjuntos empieza con un argumento +.BR start " o " stop +para especificar cuándo se van a crear enlaces para arrancar o parar +el servicio. + +Luego les sigue +.IR NN , +el código de secuencia para todos los enlaces del conjunto, y uno o +más números de nivel de ejecución, cada uno como un solo argumento. El +conjunto se termina con el argumento +.B '.' +(un punto). + +Cuando se especifican explícitamente los niveles de ejecución, +normalmente habrá un conjunto +.B start +y otro +.B stop . +Si son necesarios diferentes códigos de secuencia para los +distintos niveles de ejecución, entonces es necesario especificar +varios conjuntos +.B start +y +.B stop . + +El script +.BI /etc/init.d/nombre +debe existir antes de ejecutar +.B update-rc.d +para crear los enlaces. +.SH BORRADO DE LOS SCRIPTS +Cuando se ejecuta con la opción +.I remove +, update-rc.d borra todos los enlaces dentro del directorio +.BI /etc/rc[nivel_de_ejecución].d +que apunten al script +.BI /etc/init.d/nombre\fR . +El script debe haber sido borrado previamente ( +.B update-rc.d +lo comprueba ). +Normalmente los scripts post-eliminación de los paquetes ejecutan +.B update-rc.d +cuando detectan que su primer argumento es +.BR purge +, dado que esto indica que el administrador ha pedido explícitamente +que se borren los scripts de configuración proporcionados por el paquete. + +Cualquier fichero en los directorios +.BI /etc/rc[nivel_de_ejecución].d +que no sea un enlace simbólico apuntando a un script en +.BI /etc/init.d/nombre +se mantendrá intacto. +.SH OPCIONES +.TP +.I -n +No hacer nada, solamente indicar que hubiera hecho. +.TP +.I -f +Borrar los enlaces incluso si todavía existe el script +.BI /etc/init.d/nombre . +.SH EJEMPLOS +Crear los enlaces usando los parámetros por omisión: +.nf +.B update-rc.d foobar defaults +.fi +Comando equivalente usando explícitamente un conjunto de argumentos: +.nf +.B update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 . +.fi +.SH FALLOS + +No existe aún una forma para que el administrador pueda especificar al menos +los niveles de ejecución que +.B update-rc.d +usará por defecto para arrancar y parar los servicios cuando se +utilice la opción +.B defaults +ni la posibilidad de cambiar otros comportamientos. +.SH FICHEROS +.TP +.B /etc/init.d/ +El directorio que contienen los scripts de arranque y parada. +.TP +.B /etc/rc?.d/ +Los directorios que contienen los enlaces usados por +.BR init +y administrados por +.BR update-rc.d . +.TP +.B /etc/init.d/skeleton +Un modelo a usar por los que escriban scripts de +.B init.d . + +.SH VER ADEMÁS +.IR "Manual de normativa de Debian" +, modelo a usar por los que escriban scripts de +.B init.d . + +.BR /etc/init.d/skeleton +, +.br +.BR init (8) . + +.SH TRADUCTOR +Traducción de Rubén Porras Campo --- sysvinit-2.86.ds1.orig/debian/sysv-rc/man8/fr/update-rc.d.8 +++ sysvinit-2.86.ds1/debian/sysv-rc/man8/fr/update-rc.d.8 @@ -0,0 +1,192 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Authors: Ian Jackson +.\" Traduction de la révision CVS 1.4 +.TH UPDATE\-RC.D 8 "23 décembre 2003" "Projet Debian " "Utilitaires de dpkg" +.SH NOM +update\-rc.d \- Pour installer ou supprimer les liens vers les scripts d' +initialisation de type System-V +.SH SYNOPSIS +.B update\-rc.d +.RI [ -n ] +.RI [ -f ] +.IB nom " remove" +.HP +.B update-rc.d +.RI [ -n ] +.IB nom " defaults" +.RI [ NN " | " NN-start " " NN-stop ] +.HP +.B update-rc.d +.RI [ -n ] +.I nom +.BR start | stop +.IR "NN runlevel runlevel " ... +.B . +.BR start | stop +.IR "NN runlevel runlevel " ... +.BR . " ..." +.SH DESCRIPTION +.B update-rc.d +met à jour automatiquement les liens vers les scripts d'initialisation de type +System-V dont le nom est +.BI /etc/rc runlevel .d/ NNnom +vers les scripts +.BI /etc/init.d/ name \fR. +Ils sont lancés par +.B init +quand on change de niveau de fonctionnement et ils sont généralement utilisés +pour démarrer ou arrêter des services tels que les démons. +.I runlevel +est l'un des niveaux de fonctionnement autorisés par +.BR init ", " 0123456789S , +et +.I NN +est le code à deux chiffres utilisé par +.B init +pour décider de l'ordre d'exécution des scripts. + +Cette page de manuel documente seulement le comportement de +.BR update-rc.d +et son utilisation. +Pour une discussion sur la préparation des scripts pour l'initialisation de type System-V voyez +.BR init (8) +et la +.IR "charte Debian" . +.SH L'INSTALLATION DES LIENS DES SCRIPTS D'INITIALISATION +Quand update-rc.d est lancé avec les options +.BR defaults ", " start ", ou " stop, +il crée les liens +.BI /etc/rc runlevel .d/[SK] NNname +qui pointent vers le script +.BI /etc/init.d/ name\fR. + +Quand des fichiers +.BI /etc/rc runlevel .d/[SK]?? name +existent déjà, +.B update-rc.d +ne fait rien. C'est ainsi pour que l'administrateur système puisse +réarranger les liens -- à condition qu'il en reste au moins un -- sans +que sa configuration ne soit réécrite. + +Quand l'option +.B defaults +est utilisée, +.B update-rc.d +crée des liens pour démarrer un service dans les niveaux de fonctionnement +.B 2345 +et des liens pour arrêter un service dans les niveaux +.BR 016 . +Par défaut, tous les liens ont un code égal à 20, mais on peut le changer en +donnant un ou deux arguments +.I NN ; +quand un seul argument est donné, il remplace le code à la fois pour les +liens de démarrage (start) et pour les liens d'arrêt (stop) ; quand deux +arguments sont donnés, le premier remplace le code pour les liens de +démarrage (start) et le second remplace le code pour les liens d'arrêt (stop). + +Au lieu de +.B defaults, +on peut indiquer les niveaux de fonctionnement dans lesquels lancer ou +arrêter les services en utilisant une suite explicite d'ensembles d'arguments : + +Chacun de ces ensembles commence par un argument +.BR start " ou " stop +de manière à indiquer s'il faut créer des liens de démarrage ou d'arrêt. +Ensuite vient le nombre du code +.IR NN , +pour tous les liens de cet ensemble, puis un ou plusieurs nombres indiquant +le niveau de fonctionnement, un seul argument pour chacun. l'ensemble se +termine par un argument +.B . +(un simple point). + +Quand, plutôt que +.BR defaults, +on utilise une détermination explicite, il faut habituellement un ensemble de +démarrage +.B start, +et un ensemble d'arrêt +.B stop. +Quand on veut différents codes dans les différents niveaux de fonctionnement, +on peut spécifier différents ensembles de démarrage +.B start +ou différents ensembles d'arrêt +.B stop. + +Le script +.BI /etc/init.d/ name +doit exister avant de lancer +.B update-rc.d +pour créer les liens. +.SH LA SUPPRESSION DES SCRIPTS +Quand on appelle update-rc.d avec l'option +.I remove +les liens dans les répertoires +.BI /etc/rc runlevel .d +qui pointent vers le script +.BI /etc/init.d/ name\fR. +sont supprimés. +Ce script doit déjà avoir été supprimé -- +.B update-rc.d +vérifie cela. +On appelle habituellement +.B update-rc.d +dans le script « post-removal » d'un paquet et quand ce script a détecté que +son premier argument était +.BR purge ; +Cela indique que l'utilisateur a demandé le suppression de la configuration de +ce paquet. +Tout fichier dans les répertoires +.BI /etc/rc runlevel .d +qui n'est pas un lien symbolique vers le script +.BI /etc/init.d/ name +est préservé. +.SH OPTIONS +.TP +.I -n +Ne fait rien, montre seulement ce qui pourrait être fait. +.TP +.I -f +Force la suppression des liens même si +.BI /etc/init.d/ name +existe encore. +.SH EXEMPLES +Insère des liens avec l'option « defaults » : +.nf +.B " update-rc.d foobar defaults" +.fi +La même commande, avec une détermination explicite utilisant les ensembles +d'arguments : +.nf +.B " update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ." +.fi +.SH BOGUES + +Il devrait y avoir un moyen pour l'administrateur système d'indiquer à +l'option +.B defaults +au moins les niveaux de fonctionnement par défaut à utiliser pour le +démarrage et l'arrêt des services ; l'administrateur système devrait sans +doute aussi pouvoir changer d'autres choses. +.SH FICHIERS +.TP +.B /etc/init.d/ +Le répertoire qui contient en fait les scripts d'initialisation. +.TP +.B /etc/rc?.d/ +Le répertoire qui contient les liens utilisés par +.BR init +et gérés par +.BR update-rc.d. +.TP +.B /etc/init.d/skeleton +Modèle pour l'écriture des scripts de +.B init.d. +.SH VOIR AUSSI +.IR "la charte Debian" , +.br +.BR /etc/init.d/skeleton , +.br +.BR init (8). +.SH TRADUCTION +Philippe Batailler. Dec 2000. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/man8/ja/update-rc.d.8 +++ sysvinit-2.86.ds1/debian/sysv-rc/man8/ja/update-rc.d.8 @@ -0,0 +1,193 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Authors: Ian Jackson +.\" Original manpage cvs revision 1.4 +.TH UPDATE\-RC.D 8 "2 March 1998" "Debian Project" "dpkg utilities" +.SH ̾Á° +update\-rc.d \- System-V ¥¹¥¿¥¤¥ë¤Î init ¥¹¥¯¥ê¥×¥ÈÍѤΥê¥ó¥¯¤ò¥¤¥ó¥¹¥È¡¼¥ë¡¢ºï½ü¤¹¤ë +.SH ½ñ¼° +.B update\-rc.d +.RI [ -n ] +.RI [ -f ] +.IB name " remove" +.HP +.B update-rc.d +.RI [ -n ] +.RI [ -f ] +.IB name " defaults" +.RI [ NN " | " NN-start " " NN-stop ] +.HP +.B update-rc.d +.RI [ -n ] +.RI [ -f ] +.I name +.BR start | stop +.IR "NN runlevel runlevel " ... +.B . +.BR start | stop +.IR "NN runlevel runlevel " ... +.BR . " ..." +.SH ÀâÌÀ +.B update-rc.d +¤Ï¡¢ +¥¹¥¯¥ê¥×¥È +.BI /etc/init.d/ name \fR +¤Ø¤Î¥ê¥ó¥¯¤Ç¤¢¤ë +.BI /etc/rc runlevel .d/ NNname +¤ò¼«Æ°Åª¤ËºîÀ®¤¹¤ë¡£ +.BI /etc/rc runlevel .d/ NNname +¤Ï System V ¥¹¥¿¥¤¥ë¤Î init ¥¹¥¯¥ê¥×¥ÈÍѤΥê¥ó¥¯¤Ç¤¢¤ê¡¢ +¥é¥ó¥ì¥Ù¥ë¤òÊѹ¹¤¹¤ëºÝ¤Ë +.B init +¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¡¢°ìÈ̤˥ǡ¼¥â¥ó¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¡¢ +Ää»ß¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I runlevel +¤Ë¤Ï +.BR init +¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥é¥ó¥ì¥Ù¥ë¿ô +.BR 0123456789S +¤Î¤¦¤Á¤Î¤Ò¤È¤Ä¤ò»ØÄꤹ¤ë¡£ +.I NN +¤Ï 2 ·å¤Î¿ô»ú¤Ç¤¢¤ê¡¢ +.B init +¤¬¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤¹¤ë½ç½ø¤ò·è¤á¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ + +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï +.BR update-rc.d +¤Î»ÈÍÑË¡¤È¤½¤ÎÆ°ºî¤Ë¤Ä¤¤¤Æ¤Î¤ß¸ÀµÚ¤¹¤ë¡£ +System V ¥¹¥¿¥¤¥ë¤Î init ¥¹¥¯¥ê¥×¥È¤ÎÇÛÃ֤ˤĤ¤¤Æ¤ÎµÄÏÀ¤Ë¤Ï¡¢ +.BR init (8) +¤È +.IR "dpkg programmers' manual" +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH INIT ¥¹¥¯¥ê¥×¥ÈÍѤΥê¥ó¥¯¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë +.BR defaults ", " start ", " stop +¥ª¥×¥·¥ç¥ó¤Î¤¤¤º¤ì¤«¤ò»È¤Ã¤Æ¼Â¹Ô¤·¤¿¾ì¹ç¡¢ +update-rc.d ¤Ï +.BI /etc/rc runlevel .d/[SK] NNname +¤ò¥¹¥¯¥ê¥×¥È +.BI /etc/init.d/ name\fR +¤Ë¥ê¥ó¥¯¤¹¤ë¡£ + +¥Õ¥¡¥¤¥ë +.BI /etc/rc runlevel .d/[SK]?? name +¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +.B update-rc.d +¤Ï²¿¤â¤·¤Ê¤¤¡£¤³¤ì¤Ï¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤¬¤Ò¤È¤Ä¤Ç¤â¥ê¥ó¥¯¤ò»Ä¤·¤Æ¤¤¤¿ +¾ì¹ç¤Ë¡¢¤½¤ÎÀßÄê¤ò¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤¬¤Ê¤¯¡¢Ê̤ξì½ê¤Ë°ÜÆ°¤µ¤»¤ë¤³¤È +¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ + +.B defaults +¤¬»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢ +.B update-rc.d +¤Ï¥é¥ó¥ì¥Ù¥ë +.B 2345 +¤Ë¥µ¡¼¥Ó¥¹¤Îµ¯Æ°ÍÑ¥ê¥ó¥¯¤ò¡¢¥é¥ó¥ì¥Ù¥ë +.BR 016 +¤Ë¥µ¡¼¥Ó¥¹¤ÎÄä»ßÍÑ¥ê¥ó¥¯¤òºîÀ®¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥ê¥ó¥¯¤Ï¤¹¤Ù¤Æ +¤Î¥·¡¼¥±¥ó¥¹¥³¡¼¥É 20 ¤ò»ý¤Ä¤¬¡¢°ú¿ô +.I NN +¤ò¤Ò¤È¤Ä¡¢Ëô¤Ï¤Õ¤¿¤ÄÍ¿¤¨¤ë¤³¤È¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£°ú¿ô¤¬¤Ò¤È¤Ä +¤Î¾ì¹ç¡¢µ¯Æ°ÍÑ¥ê¥ó¥¯¤ÈÄä»ßÍÑ¥ê¥ó¥¯¤ÎξÊý¤Î¥·¡¼¥±¥ó¥¹¥³¡¼¥É¤òÊѹ¹¤¹ +¤ë¡£°ìÊý¡¢°ú¿ô¤¬¤Õ¤¿¤ÄÍ¿¤¨¤é¤ì¤¿¾ì¹ç¡¢¤Ò¤È¤Ä¤á¤¬µ¯Æ°ÍÑ¥ê¥ó¥¯¤Î¥·¡¼ +¥±¥ó¥¹¥³¡¼¥É¤ò¡¢¤Õ¤¿¤Ä¤á¤¬Ää»ßÍÑ¥ê¥ó¥¯¤Î¥·¡¼¥±¥ó¥¹¥³¡¼¥É¤òÊѹ¹¤¹ +¤ë¡£ + +.B defaults +¤ò»ÈÍѤ¹¤ëÂå¤ï¤ê¤Ë¡¢°ú¿ô¥»¥Ã¥È¤òÍ¿¤¨¤ë¤³¤È¤Ç +¥µ¡¼¥Ó¥¹¤òµ¯Æ°¡¢Ää»ß¤¹¤ë¥é¥ó¥ì¥Ù¥ë¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +°ú¿ô¥»¥Ã¥È¤Ï¤½¤ì¤¾¤ì°ú¿ô +.BR start " ¤Þ¤¿¤Ï " stop +¤Ç»Ï¤Þ¤ê¡¢¤³¤ì¤Ë¤è¤êµ¯Æ°ÍÑ¥ê¥ó¥¯¤Þ¤¿¤ÏÄä»ßÍÑ¥ê¥ó¥¯¤Î¤É¤Á¤é¤òºîÀ®¤¹ +¤ë¤«»ØÄꤹ¤ë¡£¼¡¤Ë¡¢°ú¿ô¥»¥Ã¥È¤Î¥ê¥ó¥¯¤¹¤Ù¤Æ¤ËÂФ¹¤ë¥·¡¼¥±¥ó¥¹¥³¡¼ +¥ÉÈÖ¹æ +.IR NN +¤ò»ØÄꤷ¡¢¹¹¤Ë¤Ò¤È¤Ä°Ê¾å¤Î¥é¥ó¥ì¥Ù¥ë¿ô¤ò¤½¤ì¤¾¤ì¤Ò¤È¤Ä¤Î°ú¿ô¤È¤·¤Æ +Í¿¤¨¤ë¡£°ú¿ô¥»¥Ã¥È¤Ï°ú¿ô +.B . +(¥Ô¥ê¥ª¥É)¤Ë¤è¤ê½ªÎ»¤¹¤ë¡£ + +.BR defaults +¤ò»ÈÍѤ»¤ºÌÀ¼¨Åª¤Ë»ØÄꤷ¤¿¾ì¹ç¡¢Ä̾ï +.B start +¥»¥Ã¥È¤È +.B stop +¥»¥Ã¥È¤¬¤Ò¤È¤Ä¤º¤Ä¸ºß¤¹¤ë¡£ + +¥é¥ó¥ì¥Ù¥ë¤´¤È¤Ë°Û¤Ê¤ë¥·¡¼¥±¥ó¥¹¥³¡¼¥É¤¬É¬Íפʾì¹ç¤Ï¡¢ +.B start +¥»¥Ã¥È¤ä +.B stop +¥»¥Ã¥È¤òÊ£¿ô»ØÄꤹ¤ë¡£ + +.B update-rc.d +¤¬¥ê¥ó¥¯¤òºîÀ®¤¹¤ëÁ°¤Ë¡¢ +¥¹¥¯¥ê¥×¥È +.BI /etc/init.d/ name +¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH ¥ê¥ó¥¯ºï½üÍѤΥ¹¥¯¥ê¥×¥È +.I remove +¥ª¥×¥·¥ç¥ó¤ò°ú¿ô¤ËÍ¿¤¨¤ë¤È¡¢ +.BI /etc/rc runlevel .d +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥¹¥¯¥ê¥×¥È +.BI /etc/init.d/ name\fR +¤Ø¤Î¥ê¥ó¥¯¤ò¤¹¤Ù¤Æºï½ü¤¹¤ë¡£ +¥¹¥¯¥ê¥×¥È¤Ï¤¢¤é¤«¤¸¤áºï½ü¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.B update-rc.d +¤Ï¤³¤ì¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£Ä̾ +.B update-rc.d +¤Ï¥Ñ¥Ã¥±¡¼¥¸¤Î postrm ¥¹¥¯¥ê¥×¥È¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¤³¤ì¤¬¼Â¹Ô¤µ¤ì¤ë¤Î¤Ï¡¢postrm ¥¹¥¯¥ê¥×¥È¤ÎÂè1°ú¿ô¤È¤·¤Æ +.BR purge +¤¬Í¿¤¨¤é¤ì¤¿¾ì¹ç¤Ç¤¢¤ê¡¢¤³¤ì¤Ï¥æ¡¼¥¶¤¬¥Ñ¥Ã¥±¡¼¥¸¤ÎÀßÄê¤òºï½ü +¤¹¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¤³¤È¤òɽ¤¹¡£ +.BI /etc/rc runlevel .d +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¤¬¥¹¥¯¥ê¥×¥È +.BI /etc/init.d/ name +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¤Ïºï½ü¤µ¤ì¤º¤Ë»Ä¤µ¤ì¤ë¡£ +.SH ¥ª¥×¥·¥ç¥ó +.TP +.I -n +¼ÂºÝ¤ÎÆ°ºî¤òɽ¼¨¤¹¤ë¤À¤±¤Ç¡¢²¿¤â¤·¤Ê¤¤¡£ +.TP +.I -f +.BI /etc/init.d/ name +¤¬Â¸ºß¤·¤¤¤Æ¤â¡¢¶¯À©Åª¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºï½ü¤¹¤ë¡£ +.SH »ÈÍÑÎã +defaults ¤ò»ÈÍѤ·¤¿¥ê¥ó¥¯¤ÎºîÀ® +.nf +.B " update-rc.d foobar defaults" +.fi +°ú¿ô¥»¥Ã¥È¤òÌÀ¼¨¤·¤¿Æ±Åù¤Î¥³¥Þ¥ó¥É +.nf +.B " update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ." +.fi +.SH ¥Ð¥° +¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Î¤¿¤á¤Ë¾¯¤Ê¤¯¤È¤â +.B defaults +¤Ç¤É¤Î¥é¥ó¥ì¥Ù¥ë¤ò start ¤Þ¤¿¤Ï stop ¤Ë¤¹¤ë¤«¤ò»ØÄê¤Ç¤­¤ëÊýË¡¤¬É¬ÍפǤ¢¤ë¡£ +¤Þ¤¿¡¢²Äǽ¤Ê¤é¤Ð +.B defaults +°Ê³°¤Î¥ª¥×¥·¥ç¥ó¤Ç¤â´ÉÍý¼Ô¤Î»ØÄê¤òÍ¥À褹¤ëÊýË¡¤¬É¬Íס£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.B /etc/init.d/ +init ¥¹¥¯¥ê¥×¥È¤¬¼ÂºÝ¤ËÃÖ¤¤¤Æ¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê +.TP +.B /etc/rc?.d/ +.BR update-rc.d +¤¬¼è¤ê°·¤¦¥ê¥ó¥¯¤ò´Þ¤ó¤À¥Ç¥£¥ì¥¯¥È¥ê¡£ +.BR init +¤Ë¤è¤ê»ÈÍѤµ¤ì¤ë¡£ +.TP +.B /etc/init.d/skeleton +.B init.d +¥¹¥¯¥ê¥×¥È¤ò½ñ¤¯¤¿¤á¤Ë»ÈÍѤ¹¤ë¿÷·¿ +.SH ´ØÏ¢¹àÌÜ +.IR "dpkg programmers manual" , +.br +.BR /etc/init.d/skeleton , +.br +.BR init (8). +.SH ËÝÌõ¼Ô +Æéë ±ÉŸ --- sysvinit-2.86.ds1.orig/debian/sysv-rc/doc/README.policy-rc.d +++ sysvinit-2.86.ds1/debian/sysv-rc/doc/README.policy-rc.d @@ -0,0 +1,102 @@ + + +This is the internal documentation for policy-rc.d, as +written by Henrique M Holschuh + +This document can be found on the web as well at +http://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt + +There is also the Debian BTS entry for the invoke-rc.d policy change at +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=76868 + + +POLICY-RC.D Policy layer (/usr/sbin/policy-rc.d) interface: +============================================================= + +Most Debian systems will not have this script as the need for a policy layer +is not very common. Most people using chroot jails just need an one-line +script which returns an exit status of 101 as the jailed +/usr/sbin/policy-rc.d script. + +The /usr/sbin/policy-rc.d file *must* be managed through the alternatives +system (/usr/sbin/update-alternatives) by any packages providing it. + +/usr/sbin/policy-rc.d [options] [] +/usr/sbin/policy-rc.d [options] --list [ ...] + +Options: + --quiet + no error messages are generated. + + --list + instead of verifying policy, list (in a "human parseable" way) all + policies defined for the given initscript id (for all runlevels if no + runlevels are specified; otherwise, list it only for the runlevels + specified), as well as all known actions and their fallbacks for the + given initscript id (note that actions and fallback actions might be + global and not particular to a single initscript id). + + is a space-separated list of actions (usually only one). Note that +the list is passed in a single parameter and not as multiple parameters. + +The following actions are always known (even if specifying a policy for them +is not supported by whatever policy-rc.d system is in use): start, +[force-]stop, restart, [force-]reload, status. + +If an out-of-runlevel start or restart attempt is detected by invoke-rc.d, +the "start" or "restart" action will be changed to "(start)" or "(restart)" +respectively. This allows policy-rc.d to differentiate an out-of-runlevel +start/restart from a normal one. + +The runlevel parameters are optional. If a runlevel is not specified, it is +considered to be unknown/undefined. Note that for sysv-like initscript +systems, an undefined runlevel is very likely to cause a 105 exit status. + +A runlevel for update-rc.d is defined as a character string, of which the +usual INIT one-character runlevels are only a subset. It may contain +embedded blanks. + + stdout is used to output a single line containing fallback actions, + or to output --list results. + stderr is used to output error messages + stdin is not to be used, this is not an interactive interface. + + Exit status codes: + 0 - action allowed + 1 - unknown action (therefore, undefined policy) + 100 - unknown initscript id + 101 - action forbidden by policy + 102 - subsystem error + 103 - syntax error + 104 - [reserved] + 105 - behaviour uncertain, policy undefined. + 106 - action not allowed. Use the returned fallback actions + (which are implied to be "allowed") instead. + +When in doubt (policy-rc.d returned status 105 or status 1), invoke-rc.d +will assume an action is allowed, but it will warn the user of the problem. + +Returning fallback information: + +Fallback actions are returned in the first line sent to stdout (other lines +will be discarded). Multiple actions to be tried are allowed, and must be +separated by spaces. Multiple actions are carried out one at a time, until +one is sucessful. + +e.g.: returning status 106 and "restart stop" in stdout (without +the quotes) will cause invoke-rc.d to attempt action "restart", +and then only if "restart" failed, attempt action "stop". + +invoke-rc.d built-in policy rules: + +To shield policy-rc.d of the underlying initscript system (file-rc, links in +/etc/rc?.d or something else), invoke-rc.d implements the following built-in +rules: + + 1. action "start" out of runlevel is denied, + (policy-rc.d receives action "(start)" instead of "start"); + 2. action "restart" out of runlevel is denied, + (policy-rc.d receives action "(restart)" instead of "restart"); + 3. any action for a non-executable initscript is denied. + +Rule 3 is absolute, policy-rc.d cannot override it. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/doc/README.invoke-rc.d +++ sysvinit-2.86.ds1/debian/sysv-rc/doc/README.invoke-rc.d @@ -0,0 +1,135 @@ + + +This is the internal documentation for invoke-rc.d, as +written by Henrique M Holschuh + +This document can be found on the web as well at +http://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt + +There is also the Debian BTS entry for the invoke-rc.d policy change at +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=76868 + + +INVOKE-RC.D (/usr/sbin/invoke-rc.d) interface: +============================================== + +The interface for all implementations of invoke-rc.d is mandated by the base +implementation in the sysvinit package, just like it is done for +update-rc.d. + +There is a provision for a "local initscript policy layer" (read: a call to +/usr/sbin/policy-rc.d if this executable is present in the local system), +which allows the local system administrator to control the behaviour of +invoke-rc.d for every initscript id and action. It is assumed that this +script is OPTIONAL and will by written and provided by packages other than +the initscript system (sysvinit and file-rc packages). + +The basic interface for all implementations of policy-rc.d is mandated by +the requirements of the base implementation of invoke-rc.d. This interface +will be described either in the manpage of invoke-rc.d, and in a text file +stored in /usr/share/doc/sysvinit/ by package sysvinit (which will host the +base implementation of invoke-rc.d). + +Proposed script interfaces: + +invoke-rc.d [options] [extra initscript parameters...] + + basename - Initscript ID, as per update-rc.d(8) + action - Initscript action. Known actions are: + start, [force-]stop, restart, + [force-]reload, status + (status is there because of the LSB. Debian does not use it). + + extra initscript parameters: These parameters are passed to the initscript + as is, after the action parameter. is always the first paramenter + to the initscript, and may be modified by fallback actions or policy-rc.d + requests. Note, however, that the extra parameters are not dropped or + modified even if the action (first parameter) is modified. + +Options: + + --quiet + Quiet mode, no error messages are generated by invoke-rc.d; policy-rc.d + is also called with --quiet if this option is in effect. + + --force + Try to run init script regardless of policy and non-fatal errors. Use + of this option in automated scripts is severely discouraged as it + bypasses integrity checks. If the initscript cannot be executed, error + status 102 is returned. Do note that the policy layer call + (policy-rc.d) is NOT skipped, although its results are ignored. + + --try-anyway + Try to run the initscript even if a non-fatal subsystem error is + detected (e.g: bad rc.d symlinks). A 102 status exit code will result + if init script fails to execute anyway). Unlike --force, policy is + still enforced with --try-anyway. + + --disclose-deny + Return status code 101 instead of status code 0 if initscript action is + denied by local policy rules or runlevel constrains. An warning is + generated if the action is denied. + + --query + Returns one of status codes 100-106, does not execute the init.d + script. Implies --disclose-deny and --nofallback. Status codes 104-106 + are only generated by this option. + + Note many messages are still sent to stderr in --query mode, including + those regarding policy overrides and subsystem errors. Use --quiet if + silent --query operation is desired. + + --no-fallback + The policy layer (policy-rc.d) may return fallback actions to be run + instead of the requested action. If this option is active, a fallback + action request will be ignored and a "action not allowed" reply used in + its place. This is probably a BAD idea unless you know exactly what + you're doing. + + --help + Outputs help message to stdout + +Unknown actions may generate warnings, but are passed to the underlying +initscript anyway. The reason for the warning is simple: It is very unlikely +that an unknown action (by invoke-rc.d) will be known to the policy layer +(policy-rc.d), and therefore it may cause an initscript to execute an action +which the local system administrator would have not allowed had he known +about it. If policy-rc.d is not present, no warnings for unknown actions +are generated. + +Should an initscript be executed, invoke-rc.d ALWAYS returns the status code +returned by the initscript. Initscripts should not return status codes in +the 100+ range (this is also a LSB requirement). + +Exit status codes (LSB compatible): + 0 : success + either the init script was run and returned exit status 0 (note + that a fallback action may have been run instead of the one given + in the command line), or it was not run because of runlevel/local + policy constrains and --disclose-deny is not in effect. + 1 - 99 : reserved for init.d script + 100 : init script ID (basename) unknown + init script not registered sucessfully through + update-rc.d or init script does not exist. + This error is fatal for most initscript systems. + 101 : action not allowed + requested action will not be performed because of + runlevel or local policy constrains, and + --disclose-deny is in effect. Note that a fallback + action is NOT considered "action not allowed", + unless --nofalback is in effect. + 102 : subsystem error + initscript (or policy) subsystem malfuncion. + (e.g. broken /sbin/runlevel). + Also, forced initscript execution due to + --try-anyway or --force failed. + 103 : syntax error + 104 : action allowed + --query is in effect; init script would be run if + not for --query. + 105 : behaviour uncertain + cannot determine if action should be carried out or + not, and --query in effect. + 106 : fallback action requested + the policy layer denied the requested action, and + supplied an allowed fallback action. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/doc/README.runlevels +++ sysvinit-2.86.ds1/debian/sysv-rc/doc/README.runlevels @@ -0,0 +1,103 @@ + + Order of scripts run in /etc/rc?.d + ================================== + +0. Overview. + + All scripts executed by the init system are located in /etc/init.d. + The directories /etc/rc?.d (? = S, 0 .. 6) contain relative links to + those scripts. These links are named S<2-digit-number> + or K<2-digit-number>. + + If a scripts has the ".sh" suffix it is a bourne shell script and + MAY be handled in an optimized manner. The behaviour of executing the + script in an optimized way will not differ in any way from it being + forked and executed in the regular way. + + The following runlevels are defined: + + N System bootup (NONE). + S Single user mode (not to be switched to directly) + 0 halt + 1 single user mode + 2 .. 5 multi user mode + 6 reboot + +1. Boot. + + When the systems boots, the /etc/init.d/rcS script is executed. It + in turn executes all the S* scripts in /etc/rcS.d in alphabetical + (and thus numerical) order. The first argument passed to the + executed scripts is "start". The runlevel at this point is "N" (none). + + Only things that need to be run once to get the system in a consistent + state are to be run. The rcS.d directory is NOT meant to replace rc.local. + One should not start daemons in this runlevel unless absolutely + necessary. Eg, NFS might need the portmapper, so it is OK to start it + early in the bootprocess. But this is not the time to start the + squid proxy server. + +2. Going multiuser. + + After the rcS.d scripts have been executed, init switches to the + default runlevel as specified in /etc/inittab, usually "2". + + Init then executes the /etc/init.d/rc script which takes care of + starting the services in /etc/rc2.d. + + Because the previous runlevel is "N" (none) the /etc/rc2.d/KXXxxxx + scripts will NOT be executed - there is nothing to stop yet, + the system is busy coming up. + + If for example there is a service that wants to run in runlevel 4 + and ONLY in that level, it will place a KXXxxxx script in + /etc/rc{2,3,5}.d to stop the service when switching out of runlevel 4. + We do not need to run that script at this point. + + The /etc.rc2.d/SXXxxxx scripts will be executed in alphabetical + order, with the first argument set to "start". + +3. Switching runlevels. + + When one switches from (for example) runlevel 2 to runlevel 3, + /etc/init.d/rc will first execute in alphabetical order all K + scripts for runlevel 3 (/etc/rc3.d/KXXxxxx) with as first argument + "stop" and then all S scripts for runlevel 3 (/etc/rc3.d/SXXxxxx) + with as first argument "start". + + As an optimization, a check is made for each "service" to see if + it was already running in the previous runlevel. If it was, and there + is no K (stop) script present for it in the new runlevel, there is + no need to start it a second time so that will not be done. + + On the other hand, if there was a K script present, it is assumed the + service was stopped on purpose first and so needs to be restarted. + + We MIGHT make the same optimization for stop scripts as well- + if no S script was present in the previous runlevel, we can assume + that service was not running and we don't need to stop it either. + In that case we can remove the "coming from level N" special case + mentioned above in 2). But right now that has not been implemented. + +4. Single user mode. + + Switching to single user mode is done by switching to runlevel 1. + That will cause all services to be stopped (assuming they all have + a K script in /etc/rc1.d). The runlevel 1 scripts will then switch + to runlevel "S" which has no scripts - all it does is spawn + a shell directly on /dev/console for maintenance. + +5. Halt/reboot + + Going to runlevel 0 or 6 will cause the system to be halted or rebooted, + respectively. For example, if we go to runlevel 6 (reboot) first + all /etc/rc6.d/KXXxxxx scripts will be executed alphabetically with + "stop" as the first argument. + + Then the /etc/rc6.d/SXXxxxx scripts will be executed alphabetically + with "stop" as the first argument as well. The reason is that there + is nothing to start anymore at this point - all scripts that are + run are meant to bring the system down. + + In the future, the /etc/rc6.d/SXXxxxx scripts MIGHT be moved to + /etc/rc6.d/K1XXxxxx for clarity. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/doc/README.Debian +++ sysvinit-2.86.ds1/debian/sysv-rc/doc/README.Debian @@ -0,0 +1,20 @@ +README for sysv-rc +------------------ + +Policy requires that maintainer scripts use update-rc.d to register and +deregister initscripts. An unfortunate result of this policy, combined +with shortcomings in current update-rc.d implementations, is that there +is no way for maintainer scripts to change the sequence number of an +initscript that has already been registered if and only if its sequence +number has not been changed by the administrator. update-rc.d *never* +changes the sequence number of an already registered initscript, even +if its sequence number has not been changed by the administrator. +There are no plans to fix this problem. Therefore, if it is necessary +to change the sequence number of an initscript in order to fix a bug +then the maintainer script should go ahead and do: + + update-rc.d -f remove + +before the new update-rc.d call, even though this overrides out any +administrator changes. + --- sysvinit-2.86.ds1.orig/debian/sysv-rc/etc/init.d/README +++ sysvinit-2.86.ds1/debian/sysv-rc/etc/init.d/README @@ -0,0 +1,32 @@ + Configuration of System V init under Debian GNU/Linux + +Most Unix versions have a file here that describes how the scripts +in this directory work, and how the links in the /etc/rc?.d/ directories +influence system startup/shutdown. + +For Debian, this information is contained in the policy manual, chapter +"System run levels and init.d scripts". The Debian Policy Manual is +available at: + + http://www.debian.org/doc/debian-policy/#contents + +The Debian Policy Manual is also available in the Debian package +"debian-policy". When this package is installed, the policy manual can be +found in directory /usr/share/doc/debian-policy. If you have a browser +installed you can probably read it at + + file://localhost/usr/share/doc/debian-policy/ + +Some more detailed information can also be found in the files in the +/usr/share/doc/sysv-rc directory. + +Debian Policy dictates that /etc/init.d/*.sh scripts must work properly +when sourced. The following additional rules apply: + +* /etc/init.d/*.sh scripts may not rely for their correct functioning + on their being sourced rather than executed. That is, they must work + properly when executed too. They must include "#!/bin/sh" at the top. + +* /etc/init.d/*.sh scripts must conform to the rules for sh scripts as + spelled out in the Debian policy section entitled "Scripts" (§10.4). + --- sysvinit-2.86.ds1.orig/debian/sysv-rc/etc/init.d/rc +++ sysvinit-2.86.ds1/debian/sysv-rc/etc/init.d/rc @@ -0,0 +1,346 @@ +#! /bin/sh +# +# rc +# +# Starts/stops services on runlevel changes. +# +# Optimization: A start script is not run when the service was already +# configured to run in the previous runlevel. A stop script is not run +# when the the service was already configured not to run in the previous +# runlevel. +# +# Authors: +# Miquel van Smoorenburg +# Bruce Perens + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +export PATH + +# Un-comment the following for debugging. +# debug=echo + +# Specify method used to enable concurrent init.d scripts. +# Valid options are 'none', 'shell' and 'startpar' +CONCURRENCY=none + +# Make sure the name survive changing the argument list +scriptname="$0" + +umask 022 + +# +# Stub to do progress bar ticks (currently just for usplash) on startup +# +startup_progress() { + $@ + step=$(($step + $step_change)) + progress=$(($step * $progress_size / $num_steps + $first_step)) + if type usplash_write >/dev/null 2>&1; then + usplash_write "PROGRESS $progress" || true + fi +} + +# +# Start script or program. +# +case "$CONCURRENCY" in + none) + startup() { + action=$1 + shift + scripts="$@" + sh=sh + # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced + # However, some important packages currently contain .sh scripts + # that do "exit" at some point, thus killing this process. Bad! + #[ S = "$runlevel" ] && sh=. + for script in $scripts ; do + case "$script" in + *.sh) + if [ "." = "$sh" ] ; then + set "$action" + RC_SAVE_PATH="$PATH" + startup_progress $debug . "$script" + PATH="$RC_SAVE_PATH" + else + startup_progress $debug $sh "$script" $action + fi + ;; + *) + startup_progress $debug "$script" $action + ;; + esac + done + } + ;; + shell) + startup() { + action=$1 + shift + scripts="$@" + sh=sh + # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced + # However, some important packages currently contain .sh scripts + # that do "exit" at some point, thus killing this process. Bad! + #[ S = "$runlevel" ] && sh=. + backgrounded=0 + for script in $scripts ; do + case "$script" in + *.sh) + if [ "." = "$sh" ] ; then + set "$action" + RC_SAVE_PATH="$PATH" + startup_progress $debug . "$script" + PATH="$RC_SAVE_PATH" + else + startup_progress $debug $sh "$script" $action + fi + ;; + *) + startup_progress $debug "$script" $action & + backgrounded=1 + ;; + esac + done + [ 1 = "$backgrounded" ] && wait + } + ;; + startpar) + startup() { + action=$1 + shift + scripts="$@" + sh=sh + # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced + # However, some important packages currently contain .sh scripts + # that do "exit" at some point, thus killing this process. Bad! + #[ S = "$runlevel" ] && sh=. + # Make sure .sh scripts are sourced in runlevel S + if [ "." = "$sh" ] ; then + newscripts= + for script in $scripts ; do + case "$script" in + *.sh) + set "$action" + RC_SAVE_PATH="$PATH" + startup_progress $debug . "$script" + PATH="$RC_SAVE_PATH" + ;; + *) + newscripts="$newscripts $script" + ;; + esac + done + scripts="$newscripts" + fi + + # startpar is not working as it should yet [pere 2005-09-10] + [ -n "$scripts" ] && startup_progress $debug startpar -a $action $scripts + startup_progress $debug startpar -a $action $scripts + } + ;; +esac + +on_exit() { + echo "error: '$scriptname' exited outside the expected code flow." +} +trap on_exit EXIT # Enable emergency handler + +# Ignore CTRL-C only in this shell, so we can interrupt subprocesses. +trap ":" INT QUIT TSTP + +# Should we also output to the console? +# /proc won't be mounted if we don't have an initramfs, but then we're +# dealing with custom systems so it's their own fault that they'll get +# output from rcS ;) +if grep -w -q quiet /proc/cmdline 2>/dev/null; then + QUIET=yes +else + QUIET=no +fi +export QUIET + +# Set onlcr to avoid staircase effect. +if [ "$QUIET" != yes ]; then + stty onlcr /dev/console 2>&1 +fi + +# Now find out what the current and what the previous runlevel are. +runlevel=$RUNLEVEL + +# Get first argument. Set new runlevel to this argument. +[ "$1" != "" ] && runlevel=$1 +if [ "$runlevel" = "" ] +then + echo "Usage: $scriptname " >&2 + exit 1 +fi +previous=$PREVLEVEL +[ "$previous" = "" ] && previous=N + +export runlevel previous + +if [ S = "$runlevel" ] +then + # + # See if system needs to be setup. This is ONLY meant to + # be used for the initial setup after a fresh installation! + # + if [ -x /sbin/unconfigured.sh ] + then + /sbin/unconfigured.sh + fi +fi + +. /etc/default/rcS +export VERBOSE + +# Is there an rc directory for this new runlevel? +if [ -d /etc/rc$runlevel.d ] +then + # Find out where in the progress bar the initramfs got to. + PROGRESS_STATE=0 + if [ -f /dev/.initramfs/progress_state ]; then + . /dev/.initramfs/progress_state + fi + + # Split the remaining portion of the progress bar into thirds + progress_size=$(((100 - $PROGRESS_STATE) / 3)) + + case "$runlevel" in + 0|6) + ACTION=stop + # Count down from 0 to -100 and use the entire bar + first_step=0 + progress_size=100 + step_change=-1 + ;; + S) + ACTION=start + # Begin where the initramfs left off and use 2/3 + # of the remaining space + first_step=$PROGRESS_STATE + progress_size=$(($progress_size * 2)) + step_change=1 + ;; + *) + ACTION=start + # Begin where rcS left off and use the final 1/3 of + # the space (by leaving progress_size unchanged) + first_step=$(($progress_size * 2 + $PROGRESS_STATE)) + step_change=1 + ;; + esac + + # Count the number of scripts we need to run (for usplash progress bar) + num_steps=0 + for s in /etc/rc$runlevel.d/[SK]*; do + case "${s##/etc/rc$runlevel.d/S??}" in + gdm|xdm|kdm|ltsp-client|reboot|halt) + break + ;; + esac + num_steps=$(($num_steps + 1)) + done + + step=0 + + # First, run the KILL scripts. + if [ "$previous" != N ] + then + # Run all scripts with the same level in parallel + CURLEVEL="" + for s in /etc/rc$runlevel.d/K* + do + level=$(echo $s | sed 's/.*\/K\([0-9][0-9]\).*/\1/') + if [ "$level" = "$CURLEVEL" ] + then + continue + fi + CURLEVEL=$level + SCRIPTS="" + for i in /etc/rc$runlevel.d/K$level* + do + # Check if the script is there. + [ ! -f $i ] && continue + + # + # Find stop script in previous runlevel but + # no start script there. + # + suffix=${i#/etc/rc$runlevel.d/K[0-9][0-9]} + previous_stop=/etc/rc$previous.d/K[0-9][0-9]$suffix + previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix + # + # If there is a stop script in the previous level + # and _no_ start script there, we don't + # have to re-stop the service. + # + [ -f $previous_stop ] && [ ! -f $previous_start ] && continue + + # Stop the service. + SCRIPTS="$SCRIPTS $i" + done + startup stop $SCRIPTS + done + fi + + # Now run the START scripts for this runlevel. + # Run all scripts with the same level in parallel + CURLEVEL="" + for s in /etc/rc$runlevel.d/S* + do + level=$(echo $s | sed 's/.*\/S\([0-9][0-9]\).*/\1/') + if [ "$level" = "$CURLEVEL" ] + then + continue + fi + CURLEVEL=$level + SCRIPTS="" + for i in /etc/rc$runlevel.d/S$level* + do + [ ! -f $i ] && continue + + if [ "$previous" != N ] + then + # + # Find start script in previous runlevel and + # stop script in this runlevel. + # + suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]} + stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix + previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix + # + # If there is a start script in the previous level + # and _no_ stop script in this level, we don't + # have to re-start the service. + # + [ -f $previous_start ] && [ ! -f $stop ] && continue + fi + SCRIPTS="$SCRIPTS $i" + done + startup $ACTION $SCRIPTS + done +fi + +if [ S = "$runlevel" ] +then + # + # For compatibility, run the files in /etc/rc.boot too. + # + [ -d /etc/rc.boot ] && run-parts /etc/rc.boot + + # + # Finish setup if needed. The comment above about + # /sbin/unconfigured.sh applies here as well! + # + if [ -x /sbin/setup.sh ] + then + /sbin/setup.sh + fi +fi + +trap - EXIT # Disable emergency handler + +exit 0 + --- sysvinit-2.86.ds1.orig/debian/sysv-rc/etc/init.d/rcS +++ sysvinit-2.86.ds1/debian/sysv-rc/etc/init.d/rcS @@ -0,0 +1,8 @@ +#! /bin/sh +# +# rcS +# +# Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order +# + +exec /etc/init.d/rc S --- sysvinit-2.86.ds1.orig/debian/sysv-rc/etc/rcS.d/README +++ sysvinit-2.86.ds1/debian/sysv-rc/etc/rcS.d/README @@ -0,0 +1,20 @@ +The scripts in this directory whose names begin with an 'S' are executed +once when booting the system, even when booting directly into single user +mode. + +The scripts are all symbolic links whose targets are located in +/etc/init.d/ . + +To disable a script in this directory, rename it so that it begins with +a 'K'. + +For a more information see /etc/init.d/README. + +The following sequence points are defined at this time: + +* After the S40 scripts have executed, all local file systems are mounted + and networking is available. All device drivers have been initialized. + +* After the S60 scripts have executed, the system clock has been set, NFS + filesystems have been mounted (unless the system depends on the automounter, + which is started later) and the filesystems have been cleaned. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/etc/rc6.d/README +++ sysvinit-2.86.ds1/debian/sysv-rc/etc/rc6.d/README @@ -0,0 +1,11 @@ +The scripts in this directory are executed once when entering +runlevel 6. + +The scripts are all symbolic links whose targets are located in +/etc/init.d/ . + +Generally it is not necessary to alter the scripts in this directory. +Their purpose is to stop all services and to make the system ready +for reboot. + +For a more information see /etc/init.d/README. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/etc/rc1.d/README +++ sysvinit-2.86.ds1/debian/sysv-rc/etc/rc1.d/README @@ -0,0 +1,11 @@ +The scripts in this directory are executed each time the system enters +this runlevel. + +The scripts are all symbolic links whose targets are located in +/etc/init.d/ . + +Generally it is not necessary to alter the scripts in this directory. +Their purpose is to stop all services and thus to put the system in +single-user mode. + +For a more information see /etc/init.d/README. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/etc/rc0.d/README +++ sysvinit-2.86.ds1/debian/sysv-rc/etc/rc0.d/README @@ -0,0 +1,11 @@ +The scripts in this directory are executed once when entering +runlevel 0. + +The scripts are all symbolic links whose targets are located in +/etc/init.d/ . + +Generally it is not necessary to alter the scripts in this directory. +Their purpose is to stop all services and to make the system ready +for shutdown. + +For a more information see /etc/init.d/README. --- sysvinit-2.86.ds1.orig/debian/sysv-rc/sbin/invoke-rc.d +++ sysvinit-2.86.ds1/debian/sysv-rc/sbin/invoke-rc.d @@ -0,0 +1,447 @@ +#!/bin/sh +# +# invoke-rc.d.sysvinit - Executes initscript actions +# +# SysVinit /etc/rc?.d version for Debian's sysvinit package +# +# Copyright (C) 2000,2001 Henrique de Moraes Holschuh +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +# Constants +RUNLEVEL=/sbin/runlevel +POLICYHELPER=/usr/sbin/policy-rc.d +INITDPREFIX=/etc/init.d/ +RCDPREFIX=/etc/rc + +# Options +BEQUIET= +MODE= +ACTION= +FALLBACK= +NOFALLBACK= +FORCE= +RETRY= +RETURNFAILURE= +RC= + +# Shell options +set +e + +dohelp () { + # + # outputs help and usage + # +cat < + +Usage: + invoke-rc.d [options] [extra parameters] + + basename - Initscript ID, as per update-rc.d(8) + action - Initscript action. Known actions are: + start, [force-]stop, restart, + [force-]reload, status + WARNING: not all initscripts implement all of the above actions. + + extra parameters are passed as is to the initscript, following + the action (first initscript parameter). + +Options: + --quiet + Quiet mode, no error messages are generated. + --force + Try to run the initscript regardless of policy and subsystem + non-fatal errors. + --try-anyway + Try to run init script even if a non-fatal error is found. + --disclose-deny + Return status code 101 instead of status code 0 if + initscript action is denied by local policy rules or + runlevel constrains. + --query + Returns one of status codes 100-106, does not run + the initscript. Implies --disclose-deny and --no-fallback. + --no-fallback + Ignores any fallback action requests by the policy layer. + Warning: this is usually a very *bad* idea for any actions + other than "start". + --help + Outputs help message to stdout + +EOF +} + +printerror () { + # + # prints an error message + # $* - error message + # +if test x${BEQUIET} = x ; then + echo `basename $0`: "$*" >&2 +fi +} + +formataction () { + # + # formats a list in $* into $printaction + # for human-friendly printing to stderr + # and sets $naction to action or actions + # +printaction=`echo $* | sed 's/ /, /g'` +if test $# -eq 1 ; then + naction=action +else + naction=actions +fi +} + +querypolicy () { + # + # queries policy database + # returns: $RC = 104 - ok, run + # $RC = 101 - ok, do not run + # other - exit with status $RC, maybe run if $RETRY + # initial status of $RC is taken into account. + # + +policyaction="${ACTION}" +if test x${RC} = "x101" ; then + if test "${ACTION}" = "start" || test "${ACTION}" = "restart" ; then + policyaction="(${ACTION})" + fi +fi + +if test "x${POLICYHELPER}" != x && test -x "${POLICYHELPER}" ; then + FALLBACK=`${POLICYHELPER} ${BEQUIET} ${INITSCRIPTID} "${policyaction}" ${RL}` + RC=$? + formataction ${ACTION} + case ${RC} in + 0) RC=104 + ;; + 1) RC=105 + ;; + 101) if test x${FORCE} != x ; then + printerror Overriding policy-rc.d denied execution of ${printaction}. + RC=104 + fi + ;; + esac + if test x${MODE} != xquery ; then + case ${RC} in + 105) printerror policy-rc.d query returned \"behaviour undefined\", + printerror assuming \"${printaction}\" is allowed. + RC=104 + ;; + 106) formataction ${FALLBACK} + if test x${FORCE} = x ; then + if test x${NOFALLBACK} = x ; then + ACTION="${FALLBACK}" + printerror executing ${naction} \"${printaction}\" instead due to policy-rc.d request. + RC=104 + else + printerror ignoring policy-rc.d fallback request: ${printaction}. + RC=101 + fi + else + printerror ignoring policy-rc.d fallback request: ${printaction}. + RC=104 + fi + ;; + esac + fi + case ${RC} in + 100|101|102|103|104|105|106) ;; + *) printerror WARNING: policy-rc.d returned unexpected error status ${RC}, 102 used instead. + RC=102 + ;; + esac +else + if test x${RC} = x ; then + RC=104 + fi +fi +return +} + +verifyparameter () { + # + # Verifies if $1 is not null, and $# = 1 + # +if test $# -eq 0 ; then + printerror syntax error: invalid empty parameter + exit 103 +elif test $# -ne 1 ; then + printerror syntax error: embedded blanks are not allowed in \"$*\" + exit 103 +fi +return +} + +## +## main +## + +## Verifies command line arguments + +if test $# -eq 0 ; then + printerror syntax error: missing required parameter, --help assumed + dohelp + exit 103 +fi + +state=I +while test $# -gt 0 && test ${state} != III ; do + case "$1" in + --help) dohelp + exit 0 + ;; + --quiet) BEQUIET=--quiet + ;; + --force) FORCE=yes + RETRY=yes + ;; + --try-anyway) + RETRY=yes + ;; + --disclose-deny) + RETURNFAILURE=yes + ;; + --query) MODE=query + RETURNFAILURE=yes + ;; + --no-fallback) + NOFALLBACK=yes + ;; + --*) printerror syntax error: unknown option \"$1\" + exit 103 + ;; + *) case ${state} in + I) verifyparameter $1 + INITSCRIPTID=$1 + ;; + II) verifyparameter $1 + ACTION=$1 + ;; + esac + state=${state}I + ;; + esac + shift +done + +if test ${state} != III ; then + printerror syntax error: missing required parameter + exit 103 +fi + +#NOTE: It may not be obvious, but "$@" from this point on must expand +#to the extra initscript parameters, except inside functions. + +## sanity checks and just-in-case warnings. +case ${ACTION} in + start|stop|force-stop|restart|reload|force-reload|status) + ;; + *) + if test "x${POLICYHELPER}" != x && test -x "${POLICYHELPER}" ; then + printerror action ${ACTION} is unknown, but proceeding anyway. + fi + ;; +esac + +## Verifies if the given initscript ID is known +## For sysvinit, this error is critical +if test ! -f "${INITDPREFIX}${INITSCRIPTID}" ; then + printerror unknown initscript, ${INITDPREFIX}${INITSCRIPTID} not found. + exit 100 +fi + +## Queries sysvinit for the current runlevel +RL=`${RUNLEVEL} | sed 's/.*\ //'` +if test ! $? ; then + printerror "could not determine current runlevel" + if test x${RETRY} = x ; then + exit 102 + fi + RL= +fi + +## Handles shutdown sequences VERY safely +## i.e.: forget about policy, and do all we can to run the script. +## BTW, why the heck are we being run in a shutdown runlevel?! +if test x${RL} = x0 || test x${RL} = x6 ; then + FORCE=yes + RETRY=yes + POLICYHELPER= + BEQUIET= + printerror ---------------------------------------------------- + printerror WARNING: invoke-rc.d called during shutdown sequence + printerror enabling safe mode: initscript policy layer disabled + printerror ---------------------------------------------------- +fi + +## Verifies the existance of proper S??initscriptID and K??initscriptID +## *links* in the proper /etc/rc?.d/ directory +verifyrclink () { + # + # verifies if parameters are non-dangling symlinks + # all parameters are verified + # + doexit= + while test $# -gt 0 ; do + if test ! -L "$1" ; then + printerror not a symlink: $1 + doexit=102 + fi + if test ! -f "$1" ; then + printerror dangling symlink: $1 + doexit=102 + fi + shift + done + if test x${doexit} != x && test x${RETRY} = x; then + exit ${doexit} + fi + return 0 +} + +# we do handle multiple links per runlevel +# but we don't handle embedded blanks in link names :-( +if test x${RL} != x ; then + SLINK=`ls -d -Q ${RCDPREFIX}${RL}.d/S[0-9][0-9]${INITSCRIPTID} 2>/dev/null | xargs` + KLINK=`ls -d -Q ${RCDPREFIX}${RL}.d/K[0-9][0-9]${INITSCRIPTID} 2>/dev/null | xargs` + SSLINK=`ls -d -Q ${RCDPREFIX}S.d/S[0-9][0-9]${INITSCRIPTID} 2>/dev/null | xargs` + + verifyrclink ${SLINK} ${KLINK} ${SSLINK} +fi + +testexec () { + # + # returns true if any of the parameters is + # executable (after following links) + # + while test $# -gt 0 ; do + if test -x "$1" ; then + return 0 + fi + shift + done + return 1 +} + +RC= + +### +### LOCAL INITSCRIPT POLICY: Enforce need of a start entry +### in either runlevel S or current runlevel to allow start +### or restart. +### +case ${ACTION} in + start|restart) + if testexec ${SLINK} ; then + RC=104 + elif testexec ${KLINK} ; then + RC=101 + elif testexec ${SSLINK} ; then + RC=104 + fi + ;; +esac + +# test if /etc/init.d/initscript is actually executable +if testexec "${INITDPREFIX}${INITSCRIPTID}" ; then + if test x${RC} = x && test x${MODE} = xquery ; then + RC=105 + fi + + # call policy layer + querypolicy + case ${RC} in + 101|104) + ;; + *) if test x${MODE} != xquery ; then + printerror policy-rc.d returned error status ${RC} + if test x${RETRY} = x ; then + exit ${RC} + else + RC=102 + fi + fi + ;; + esac +else + ### + ### LOCAL INITSCRIPT POLICY: non-executable initscript; deny exec. + ### (this is common sense, actually :^P ) + ### + RC=101 +fi + +## Handles --query +if test x${MODE} = xquery ; then + exit ${RC} +fi + + +setechoactions () { + if test $# -gt 1 ; then + echoaction=true + else + echoaction= + fi +} +getnextaction () { + saction=$1 + shift + ACTION="$@" +} + +## Executes initscript +## note that $ACTION is a space-separated list of actions +## to be attempted in order until one suceeds. +if test x${FORCE} != x || test ${RC} -eq 104 ; then + if testexec "${INITDPREFIX}${INITSCRIPTID}" ; then + RC=102 + setechoactions ${ACTION} + while test ! -z "${ACTION}" ; do + getnextaction ${ACTION} + if test ! -z ${echoaction} ; then + printerror executing initscript action \"${saction}\"... + fi + + "${INITDPREFIX}${INITSCRIPTID}" "${saction}" "$@" && exit 0 + RC=$? + + if test ! -z "${ACTION}" ; then + printerror action \"${saction}\" failed, trying next action... + fi + done + printerror initscript ${INITSCRIPTID}, action \"${saction}\" failed. + exit ${RC} + fi + exit 102 +fi + +## Handles --disclose-deny +if test ${RC} -eq 101 && test x${RETURNFAILURE} = x ; then + RC=0 +else + formataction ${ACTION} + printerror initscript ${naction} \"${printaction}\" not executed. +fi + +exit ${RC} --- sysvinit-2.86.ds1.orig/debian/sysv-rc/sbin/update-rc.d +++ sysvinit-2.86.ds1/debian/sysv-rc/sbin/update-rc.d @@ -0,0 +1,225 @@ +#! /usr/bin/perl +# +# update-rc.d Update the links in /etc/rc[0-9S].d/ +# + +$initd = "/etc/init.d"; +$etcd = "/etc/rc"; +$notreally = 0; + +# Print usage message and die. + +sub usage { + print STDERR "update-rc.d: error: @_\n" if ($#_ >= 0); + print STDERR < remove + update-rc.d [-n] defaults|multiuser [NN | sNN kNN] + update-rc.d [-n] start|stop NN runlvl [runlvl] [...] . + -n: not really + -f: force +EOF + exit (1); +} + +# Check out options. + +while($#ARGV >= 0 && ($_ = $ARGV[0]) =~ /^-/) { + shift @ARGV; + if (/^-n$/) { $notreally++; next } + if (/^-f$/) { $force++; next } + if (/^-h|--help$/) { &usage; } + &usage("unknown option"); +} + +# Action. + +&usage() if ($#ARGV < 1); +$bn = shift @ARGV; +if ($ARGV[0] ne 'remove') { + if (! -f "$initd/$bn") { + print STDERR "update-rc.d: $initd/$bn: file does not exist\n"; + exit (1); + } +} elsif (-f "$initd/$bn") { + if (!$force) { + printf STDERR "update-rc.d: $initd/$bn exists during rc.d purge (use -f to force)\n"; + exit (1); + } +} + +$_ = $ARGV[0]; +if (/^remove$/) { &checklinks ("remove"); } +elsif (/^defaults$/) { &defaults; &makelinks } +elsif (/^multiuser$/) { &multiuser; &makelinks } +elsif (/^(start|stop)$/) { &startstop; &makelinks; } +else { &usage; } + +exit (0); + +# Check if there are links in /etc/rc[0-9S].d/ +# Remove if the first argument is "remove" and the links +# point to $bn. + +sub is_link () { + my ($op, $fn, $bn) = @_; + if (! -l $fn) { + print STDERR "update-rc.d: warning: $fn is not a symbolic link\n"; + return 0; + } else { + $linkdst = readlink ($fn); + if (! defined $linkdst) { + die ("update-rc.d: error reading symbolic link: $!\n"); + } + if (($linkdst ne "../init.d/$bn") && ($linkdst ne "$initd/$bn")) { + print STDERR "update-rc.d: warning: $fn is not a link to ../init.d/$bn or $initd/$bn\n"; + return 0; + } + } + return 1; +} + +sub checklinks { + my ($i, $found, $fn, $islnk); + + print " Removing any system startup links for $initd/$bn ...\n" + if ($_[0] eq 'remove'); + + $found = 0; + + foreach $i (0..9, 'S') { + unless (chdir ("$etcd$i.d")) { + next if ($i =~ m/^[789S]$/); + die("update-rc.d: chdir $etcd$i.d: $!\n"); + } + opendir(DIR, "."); + foreach $_ (readdir(DIR)) { + next unless (/^[SK]\d\d$bn$/); + $fn = "$etcd$i.d/$_"; + $found = 1; + $islnk = &is_link ($_[0], $fn, $bn); + next if ($_[0] ne 'remove'); + if (! $islnk) { + print " $fn is not a link to ../init.d/$bn; not removing\n"; + next; + } + print " $etcd$i.d/$_\n"; + next if ($notreally); + unlink ("$etcd$i.d/$_") || + die("update-rc.d: unlink: $!\n"); + } + closedir(DIR); + } + $found; +} + +# Process the arguments after the "defaults" keyword. + +sub defaults { + my ($start, $stop) = (20, 20); + + &usage ("defaults takes only one or two codenumbers") if ($#ARGV > 2); + $start = $stop = $ARGV[1] if ($#ARGV >= 1); + $stop = $ARGV[2] if ($#ARGV >= 2); + &usage ("codenumber must be a number between 0 and 99") + if ($start !~ /^\d\d?$/ || $stop !~ /^\d\d?$/); + + $start = sprintf("%02d", $start); + $stop = sprintf("%02d", $stop); + + $stoplinks[0] = $stoplinks[1] = $stoplinks[6] = "K$stop"; + $startlinks[2] = $startlinks[3] = + $startlinks[4] = $startlinks[5] = "S$start"; + + 1; +} + +# Process the arguments after the "multiuser" keyword. + +sub multiuser { + my ($start, $stop) = (20, 20); + + &usage ("multiuser takes only one or two codenumbers") if ($#ARGV > 2); + $start = $stop = $ARGV[1] if ($#ARGV >= 1); + $stop = $ARGV[2] if ($#ARGV >= 2); + &usage ("codenumber must be a number between 0 and 99") + if ($start !~ /^\d\d?$/ || $stop !~ /^\d\d?$/); + + $start = sprintf("%02d", $start); + $stop = sprintf("%02d", $stop); + + $stoplinks[1] = "K$stop"; + $startlinks[2] = $startlinks[3] = + $startlinks[4] = $startlinks[5] = "S$start"; + + 1; +} + +# Process the arguments after the start or stop keyword. + +sub startstop { + + my($letter, $NN, $level); + + while ($#ARGV >= 0) { + if ($ARGV[0] eq 'start') { $letter = 'S'; } + elsif ($ARGV[0] eq 'stop') { $letter = 'K' } + else { + &usage("expected start|stop"); + } + + if ($ARGV[1] !~ /^\d\d?$/) { + &usage("expected NN after $ARGV[0]"); + } + $NN = sprintf("%02d", $ARGV[1]); + + shift @ARGV; shift @ARGV; + $level = shift @ARGV; + do { + if ($level !~ m/^[0-9S]$/) { + &usage( + "expected runlevel [0-9S] (did you forget \".\" ?)"); + } + if (! -d "$etcd$level.d") { + print STDERR + "update-rc.d: $etcd$level.d: no such directory\n"; + exit(1); + } + $level = 99 if ($level eq 'S'); + $startlinks[$level] = "$letter$NN" if ($letter eq 'S'); + $stoplinks[$level] = "$letter$NN" if ($letter eq 'K'); + } while (($level = shift @ARGV) ne '.'); + &usage("action with list of runlevels not terminated by \`.'") + if ($level ne '.'); + } + 1; +} + +# Create the links. + +sub makelinks { + my($t, $i); + my @links; + + if (&checklinks) { + print " System startup links for $initd/$bn already exist.\n"; + exit (0); + } + print " Adding system startup for $initd/$bn ...\n"; + + # nice unreadable perl mess :) + + for($t = 0; $t < 2; $t++) { + @links = $t ? @startlinks : @stoplinks; + for($i = 0; $i <= $#links; $i++) { + $lvl = $i; + $lvl = 'S' if ($i == 99); + next if ($links[$i] eq ''); + print " $etcd$lvl.d/$links[$i]$bn -> ../init.d/$bn\n"; + next if ($notreally); + symlink("../init.d/$bn", "$etcd$lvl.d/$links[$i]$bn") + || die("update-rc.d: symlink: $!\n"); + } + } + + 1; +} --- sysvinit-2.86.ds1.orig/debian/initscripts/conffiles +++ sysvinit-2.86.ds1/debian/initscripts/conffiles @@ -0,0 +1,30 @@ +/etc/init.d/bootclean +/etc/init.d/bootlogd +/etc/init.d/stop-bootlogd +/etc/init.d/stop-bootlogd-single +/etc/init.d/bootmisc.sh +/etc/init.d/checkfs.sh +/etc/init.d/checkroot.sh +/etc/init.d/halt +/etc/init.d/hostname.sh +/etc/init.d/killprocs +/etc/init.d/mountall.sh +/etc/init.d/mountall-bootclean.sh +/etc/init.d/mountnfs-bootclean.sh +/etc/init.d/mountdevsubfs.sh +/etc/init.d/mountkernfs.sh +/etc/init.d/mtab.sh +/etc/init.d/reboot +/etc/init.d/rmnologin +/etc/init.d/sendsigs +/etc/init.d/single +/etc/init.d/umountfs +/etc/init.d/umountnfs.sh +/etc/init.d/umountroot +/etc/init.d/urandom +/etc/init.d/waitnfs.sh +/etc/default/bootlogd +/etc/default/devpts +/etc/default/halt +/etc/default/tmpfs +/etc/network/if-up.d/mountnfs --- sysvinit-2.86.ds1.orig/debian/initscripts/postinst +++ sysvinit-2.86.ds1/debian/initscripts/postinst @@ -0,0 +1,318 @@ +#! /bin/sh +# +# initscripts postinst +# + +set -e + +case "$1" in + configure) + PREV_VER=$2 + ;; + abort-upgrade|abort-remove|abort-deconfigure) + exit 0 + ;; +esac + +umask 022 + +# +# Function like update-rc.d but simpler & faster. +# Usage: updatercd basename start|stop NN runlevel . +# +# Heuristic: use the real update-rc.d if file-rc is detected, +# or if the /etc/rc2.d directory is not present. +# +updatercd() { + + [ -f /etc/init.d/$1 ] || return 0 + + if \ + [ -d /usr/share/file-rc/. ] \ + || [ -d /usr/lib/file-rc/. ] \ + || [ ! -d /etc/rc2.d/. ] + then + # Funniness on next line is because we are running with set -e + update-rc.d "$@" >/dev/null && return 0 || return $? + fi + + base=$1 + shift + + tmp="$(echo /etc/rc?.d/[SK]??$base)" + case "$tmp" in + "/etc/rc?.d/[SK]??$base") : ;; + *) return ;; + esac + + while [ "$1" != "" ] + do + if [ "$1" = stop ] + then + tlet=K + else + tlet=S + fi + case "$2" in + ?) lev=0$2 ;; + *) lev=$2 ;; + esac + shift 2 + while [ "$1" != "." ] + do + cd /etc/rc$1.d + ln -sf ../init.d/$base $tlet$lev$base + shift + done + shift + done +} + +# +# Initialize rcS default file. +# +if [ ! -f /etc/default/rcS ] +then + cp -p /usr/share/initscripts/default.rcS /etc/default/rcS +fi + +# +# In 2.86.ds1-7 the "single" script was moved. +# We have to remove the old links _before_ we install new ones. +# +if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-7" +then + update-rc.d -f single remove >/dev/null 2>&1 || : +fi + +# +# Okay, we could do this with update-rc.d, but that would probably +# be pretty slow. This way we win some speed. +# DO NOT FOLLOW THIS EXAMPLE IN OTHER PACKAGES. +# +# Links in runlevel S +# +updatercd mountkernfs.sh start 1 S . +updatercd hostname.sh start 2 S . +updatercd mountdevsubfs.sh start 11 S . +#updatercd modutils start 15 S . +#updatercd bootlogd start 18 S . +updatercd checkroot.sh start 20 S . +updatercd mtab.sh start 22 S . +updatercd checkfs.sh start 30 S . +updatercd mountall.sh start 35 S . +updatercd mountall-bootclean.sh start 36 S . +updatercd waitnfs.sh start 45 S . +updatercd mountnfs-bootclean.sh start 46 S . +updatercd bootmisc.sh start 80 S . +updatercd urandom start 85 S . start 30 0 6 . +# +# Links in runlevels other than S +# +updatercd sendsigs start 20 0 6 . +updatercd umountnfs.sh start 31 0 6 . +updatercd umountfs start 40 0 6 . +updatercd umountroot start 60 0 6 . +updatercd halt start 90 0 . +updatercd reboot start 90 6 . +updatercd killprocs start 30 1 . +updatercd single start 90 1 . +updatercd rc.local start 99 2 3 4 5 . +updatercd rmnologin start 99 2 3 4 5 . +#updatercd stop-bootlogd-single start 99 S . +#updatercd stop-bootlogd start 99 2 3 4 5 . + +# +# Remove scripts that were left behind by older versions +# +for F in mountkernfs devpts.sh mountvirtfs mountdevsubfs mtab +do + rm -f /etc/init.d/$F + update-rc.d $F remove >/dev/null 2>&1 || : +done + +rm -f /etc/init.d/bootclean.sh + +# +# Create /var/run and /var/lock +# +if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-6ubuntu12" +then + # We need to quickly bind / to another location so we can make them + # just in case /var is a mountpoint or a symlink to one. + mkdir /.root + mount -n --bind / /.root + + mkdir -p /.root/var/run /.root/var/lock + + umount /.root + rmdir /.root +fi + +# +# Mount /var/run and /var/lock +# +if [ "$PREV_VER" ] && dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-6ubuntu12" +then + # Make /var/run a tmpfs, and move everything onto it. This will + # probably break a few running things. If already a tmpfs, try + # cleaning up the one underneath + mkdir /tmp/.var.run + if mountpoint -q /var/run; then + mount -n --move /var/run /tmp/.var.run + else + mount -n -t tmpfs varrun /tmp/.var.run + (cd /var/run && find -print0 | cpio -p0dm /tmp/.var.run) 2>/dev/null || true + fi + find /var/run ! -type d -exec rm -f -- {} \; || true + mount -n --move /tmp/.var.run /var/run + rmdir /tmp/.var.run + + # And do the same for /var/lock + mkdir /tmp/.var.lock + if mountpoint -q /var/lock; then + mount -n --move /var/lock /tmp/.var.lock + else + mount -n -t tmpfs varlock /tmp/.var.lock + (cd /var/lock && find -print0 | cpio -p0dm /tmp/.var.lock) 2>/dev/null || true + fi + find /var/lock ! -type d -exec rm -f -- {} \; || true + mount -n --move /tmp/.var.lock /var/lock + rmdir /tmp/.var.lock + + if [ -x /usr/share/update-notifier/notify-reboot-required ]; then + /usr/share/update-notifier/notify-reboot-required + fi +fi + +# +# Create initial log files +# +[ "$PREV_VER" ] || chmod 755 /var/log/fsck || : +for F in /var/log/dmesg /var/log/boot /var/log/fsck/checkroot /var/log/fsck/checkfs +do + if [ ! -f "$F" ] && touch "$F" >/dev/null 2>&1 + then + echo "(Nothing has been logged yet.)" >| "$F" + chown root:adm "$F" + chmod 640 "$F" + fi +done + +# +# Set up nologin symlink so that dynamic-login-disabling will work +# (when DELAYLOGIN is set to "yes") +# +if [ ! -L /etc/nologin ] && [ ! -e /etc/nologin ] +then + rm -f /var/lib/initscripts/nologin + ln -s /var/lib/initscripts/nologin /etc/nologin +fi + +# +# Set up motd stuff, putting variable file in /var/run/ +# +if [ ! -f /etc/motd.tail ] +then + if [ -f /etc/motd ] + then + sed 1d /etc/motd > /etc/motd.tail + [ -s /etc/motd.tail ] || rm -f /etc/motd.tail + fi +fi +if [ ! -f /var/run/motd ] +then + if [ -f /etc/motd ] + then + cat /etc/motd > /var/run/motd + else + :>/var/run/motd + fi +fi +if [ ! -L /etc/motd ] +then + [ -f /etc/default/rcS ] && . /etc/default/rcS + if [ "$EDITMOTD" = no ] + then + cat /var/run/motd > /etc/motd.static + ln -sf motd.static /etc/motd + else + ln -sf /var/run/motd /etc/motd + fi +fi + +# +# Mount kernel virtual filesystems...not. +# This causes problems in pbuilder. +# +# +#if [ -x /etc/init.d/mountkernfs.sh ] +#then +# if which invoke-rc.d >/dev/null 2>&1 +# then +# invoke-rc.d mountkernfs.sh start || : +# else +# /etc/init.d/mountkernfs.sh start +# fi +#fi + +# +# Create /dev/pts, /dev/shm directories +# +if [ "$(uname -s)" = Linux ] +then + # + # Only create /dev/{pts,shm} if /dev is on the + # root file system. If some package has mounted a + # seperate /dev (ramfs from udev, devfs) it is + # responsible for the presence of those subdirs. + # + if ! mountpoint -q /dev + then + [ -d /dev/pts ] || { mkdir --mode=755 /dev/pts ; chown root:root /dev/pts ; } + [ -d /dev/shm ] || { mkdir --mode=755 /dev/shm ; chown root:root /dev/shm ; } + fi +fi + +# +# Create /etc/rc.local +# +if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-6ubuntu19" +then + if [ ! -e /etc/rc.local ]; then + cat << EOF > /etc/rc.local +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +exit 0 +EOF + # make sure it's enabled by default. + chmod 755 /etc/rc.local + fi +fi + +# +# Mount virtual filesystems under /dev...not. +# This causes problems in pbuilder. +# +#if [ -x /etc/init.d/mountdevsubfs.sh ] +#then +# if which invoke-rc.d >/dev/null 2>&1 +# then +# invoke-rc.d mountdevsubfs.sh start || : +# else +# /etc/init.d/mountdevsubfs.sh start +# fi +#fi + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/preinst +++ sysvinit-2.86.ds1/debian/initscripts/preinst @@ -0,0 +1,52 @@ +#! /bin/sh +# +# initscripts preinst +# + + +# Remove a no-longer used conffile +# +# $1: conffile +# +# If the argument was not listed as a conffile, silently do nothing. +# Adapted from code obtained from www.dpkg.org/ConffileHandling +eliminate_conffile() { + CONFFILE="$1" + if [ -f "$CONFFILE" ]; then + CURRENT_MD5SUM="$(md5sum "$CONFFILE" 2>/dev/null | sed -e "s/ .*//")" + FACTORY_MD5SUM="$(sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $CONFFILE'{s/.* //;p}}" /var/lib/dpkg/status)" + if [ "$CURRENT_MD5SUM" != "$FACTORY_MD5SUM" ]; then + echo -n "Renaming obsolete modified conffile " + mv -vf "$CONFFILE" "$CONFFILE".dpkg-old + else + echo -n "Unmodified conffile '${CONFFILE}' obsolete; " + rm -vf "$CONFFILE" + fi + fi +} + +case "$1" in + install|upgrade) + # + # /etc/init.d/stop-bootlogd used to be a symlink to bootlogd; + # now it is a separate script. We need to remove the symlink here, + # before dpkg installs the /etc/init.d/stop-bootlogd file. + # + [ -L /etc/init.d/stop-bootlogd ] && rm -f /etc/init.d/stop-bootlogd + # + # Remove obsolete conffiles + # + if [ "$2" ] && dpkg --compare-versions "$2" lt "2.86.ds1-10" ; then + eliminate_conffile "/etc/init.d/bootclean.sh" + fi + # + # Move conflicting log _file_ if present + # + [ -f /var/log/fsck ] && mv -f /var/log/fsck /var/log/fsck.dpkg-old + ;; + abort-upgrade) + exit 0 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/copyright +++ sysvinit-2.86.ds1/debian/initscripts/copyright @@ -0,0 +1,31 @@ +This package contains the scripts that are executed at start and +shutdown of Debian systems. + +This package is built from the `sysvinit' source package. Please +consult the copyright file of the sysvinit package for the location of +the upstream sources of the sysvinit package. Debian-specific files +for sysvinit, such as these initscripts, are maintained by the members +of the pkg-sysvinit project at alioth.debian.org. + + http://alioth.debian.org/projects/pkg-sysvinit + +Copyright 1997-2005 Miquel van Smoorenburg and +the members pkg-sysvinit project. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- sysvinit-2.86.ds1.orig/debian/initscripts/rcS.5 +++ sysvinit-2.86.ds1/debian/initscripts/rcS.5 @@ -0,0 +1,107 @@ +.TH rcS 5 "16 Jan 2006" "" "Debian Administrator's Manual" +.SH NAME +rcS \- variables that affect the behavior of boot scripts +.SH DESCRIPTION +The +.I /etc/default/rcS +file contains variable settings in POSIX format: +.IP "" .5i +VAR=VAL +.PP +Only one assignment is allowed per line. +Comments (starting with '#') are also allowed. + +.SH OPTIONS +The following variables can be set. +For the default values please see \fI/usr/share/initscripts/default.rcS\fP. + +.IP \fBTMPTIME\fP +On boot the files in /tmp will be deleted if their modification time +is more than TMPTIME days ago. +A value of 0 means that files are removed regardless of age. +If you don't want the system to clean /tmp +then set TMPTIME to a negative value (e.g., \-1) +or to the word \fIinfinite\fP. + +.IP \fBSULOGIN\fB +Setting this to +.B yes +causes init to spawn a +.B sulogin +on the console early in the boot process. +If the administrator does not login +then the sulogin session will time out +after 30 seconds and the boot process will continue. + +.IP \fBDELAYLOGIN\fB +Normally the system will not let non-root users log in +until the boot process is complete +and the system has finished switching +to the default runlevel (usually level 2). +However, in theory it is safe to log in a bit earlier, +namely, as soon as \fBinetd\fP has started. +Setting the variable to \fBno\fP allows earlier login; +setting the variable to \fByes\fP prevents it. + +Some details: +The \fBDELAYLOGIN\fP variable controls whether or not the +file \fI/var/lib/initscripts/nologin\fP is created during +the boot process and deleted at the end of it. +\fI/etc/nologin\fP is normally a symbolic link to the latter location, +and the \fBlogin\fP(1) program refuses to allow non-root logins so long +as (the target of) \fI/etc/nologin\fP exists. +If you set the variable to \fBno\fP then it is advisable to ensure +that \fI/var/lib/initscripts/nologin\fP does not exist. + +.IP \fBUTC\fP +This is used to govern how the hardware real time clock is interpreted +when it is read (e.g., at boot time, for the purpose of setting the +system clock) and when it is written (e.g., at shutdown). +If this option is set to \fBno\fP +then the system clock is assumed to be set to local time. +If the option is set to \fByes\fP +then the system clock is assumed to be set to something approximating +Coordinated Universal Time (UTC). +(POSIX systems keep a variant of UTC, without leap seconds.) + +On contemporary Debian systems +(although change has been requested at +\fIhttp://bugs.debian.org/346342\fP), +if UTC is set to \fBno\fP then \fI/usr/share/zoneinfo\fP +must be readable early in the boot process. +If you want to keep \fI/usr\fP on a separate filesystem then +you must still ensure that the target of \fI/etc/localtime\fP +points to the correct zone information file for the time zone +of the time kept in your hardware real time clock. + +.IP \fBVERBOSE\fP +Setting this option to \fBno\fP (in lower case) will make the boot process +a bit less verbose. +Setting this option to \fByes\fP will make the boot process +a bit more verbose. + +.IP \fBFSCKFIX\fP +When the root and all other file systems are checked, +.B fsck +is invoked with the \fB\-a\fP option +which means "autorepair". +If there are major inconsistencies +then the fsck process will bail out. +The system will print a message +asking the administrator to repair the file system maually +and will present a root shell prompt +(actually a \fIsulogin\fP prompt) +on the console. +Setting this option to \fByes\fP causes the fsck commands +to be run with the \fB\-y\fP option instead of the \fB\-a\fP option. +This will tell fsck always to repair the file systems +without asking for permission. + +.SH NOTE +The \fBEDITMOTD\fP variable is no longer used. + +.SH AUTHOR +Miquel van Smoorenburg + +.SH SEE ALSO +.BR inetd "(8), " init "(8), " inittab "(5), " login "(1)." --- sysvinit-2.86.ds1.orig/debian/initscripts/linda.overrides +++ sysvinit-2.86.ds1/debian/initscripts/linda.overrides @@ -0,0 +1,2 @@ +Tag: etc-conffile +Data: skeleton --- sysvinit-2.86.ds1.orig/debian/initscripts/postrm +++ sysvinit-2.86.ds1/debian/initscripts/postrm @@ -0,0 +1,51 @@ +#! /bin/sh +# +# initscripts postrm +# + +set -e + +case "$1" in + purge) + # + # Remove abandoned conffiles + # + rm -f \ + /etc/init.d/bootclean.sh \ + /etc/init.d/bootclean.sh.dpkg-old + + # + # Remove configuration files + # + rm -f \ + /etc/default/rcS \ + /etc/nologin \ + /etc/motd.tail \ + /etc/motd.static \ + /etc/motd + + # + # Remove state files + # + rm -f /var/lib/initscripts/nologin + + # + # Remove run time state files + # + rm -f /var/run/motd + + # + # Remove log files + # + rm -f \ + /var/log/dmesg \ + /var/log/boot \ + /var/log/fsck/checkroot \ + /var/log/fsck/checkfs + + # Remove rc symlinks ? + # Remove /dev/pts and /dev/shm ? + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/lintian.overrides +++ sysvinit-2.86.ds1/debian/initscripts/lintian.overrides @@ -0,0 +1,3 @@ +initscripts: script-in-etc-init.d-not-registered-via-update-rc.d +initscripts: file-in-etc-not-marked-as-conffile /etc/init.d/skeleton +initscripts: non-standard-toplevel-dir sys/ --- sysvinit-2.86.ds1.orig/debian/initscripts/share/default.rcS +++ sysvinit-2.86.ds1/debian/initscripts/share/default.rcS @@ -0,0 +1,15 @@ +# +# /etc/default/rcS +# +# Default settings for the scripts in /etc/rcS.d/ +# +# For information about these variables see the rcS(5) manual page. +# +# This file belongs to the "initscripts" package. + +TMPTIME=0 +SULOGIN=no +DELAYLOGIN=no +UTC=yes +VERBOSE=no +FSCKFIX=no --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/default/devpts +++ sysvinit-2.86.ds1/debian/initscripts/etc/default/devpts @@ -0,0 +1,5 @@ +# GID of the `tty' group +TTYGRP=5 + +# Set to 600 to have `mesg n' be the default +TTYMODE=620 --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/default/halt +++ sysvinit-2.86.ds1/debian/initscripts/etc/default/halt @@ -0,0 +1,2 @@ +# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff". +HALT=poweroff --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/default/bootlogd +++ sysvinit-2.86.ds1/debian/initscripts/etc/default/bootlogd @@ -0,0 +1,2 @@ +# Run bootlogd at startup ? +BOOTLOGD_ENABLE=No --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/default/tmpfs +++ sysvinit-2.86.ds1/debian/initscripts/etc/default/tmpfs @@ -0,0 +1,6 @@ +# 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= --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/checkfs.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/checkfs.sh @@ -0,0 +1,129 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: checkfs +# Required-Start: modutils checkroot +# Required-Stop: +# Should-Start: lvm cryptdisks +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Check all filesystems. +### END INIT INFO + +PATH=/sbin:/bin +FSCK_LOGFILE=/var/log/fsck/checkfs +[ "$FSCKFIX" ] || FSCKFIX=no +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +# Always output fsck progress +stdin=`readlink /proc/self/fd/0` +if [ "${stdin#/dev/null}" != "$stdin" ]; then + exec /dev/console 2>&1 +fi + +do_start () { + # See if we're on AC Power + # If not, we're not gonna run our check + if which on_ac_power >/dev/null 2>&1 + then + on_ac_power >/dev/null 2>&1 + if [ $? -eq 1 ] + then + [ "$VERBOSE" = no ] || log_success_msg "Running on battery power, so skipping file system check." + BAT=yes + fi + fi + + # + # Check the rest of the file systems. + # + if [ ! -f /fastboot ] && [ ! "$BAT" ] && [ "$FSCKTYPES" != "none" ] + then + if [ -f /forcefsck ] + then + force="-f" + else + force="" + fi + if [ "$FSCKFIX" = yes ] + then + fix="-y" + else + fix="-a" + fi + spinner="-C" + case "$TERM" in + dumb|network|unknown|"") + spinner="" + ;; + esac + [ "$(uname -m)" = s390 ] && spinner="" # This should go away + FSCKTYPES_OPT="" + [ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES" + handle_failed_fsck() { + log_failure_msg "File system check failed. +A log is being saved in ${FSCK_LOGFILE} if that location is writable. +Please repair the file system manually." + log_warning_msg "A maintenance shell will now be started. +CONTROL-D will terminate this shell and resume system boot." + # Start a single user shell on the console + if ! sulogin $CONSOLE + then + log_failure_msg "Attempt to start maintenance shell failed. +Continuing with system boot in 5 seconds." + sleep 5 + fi + } + if [ "$VERBOSE" = no ] + then + log_action_begin_msg "Checking file systems" + logsave -s $FSCK_LOGFILE fsck $spinner -R -A $fix $force $FSCKTYPES_OPT + FSCKCODE=$? + if [ "$FSCKCODE" -gt 1 ] + then + log_action_end_msg 1 "code $FSCKCODE" + handle_failed_fsck + else + log_action_end_msg 0 + fi + else + if [ "$FSCKTYPES" ] + then + log_action_msg "Will now check all file systems of types $FSCKTYPES" + else + log_action_msg "Will now check all file systems" + fi + logsave -s $FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT + FSCKCODE=$? + if [ "$FSCKCODE" -gt 1 ] + then + handle_failed_fsck + else + log_success_msg "Done checking file systems. +A log is being saved in ${FSCK_LOGFILE} if that location is writable." + fi + fi + fi + rm -f /fastboot /forcefsck +} + +case "$1" in + start|"") + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: checkfs.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/mountdevsubfs.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/mountdevsubfs.sh @@ -0,0 +1,67 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mountdevsubfs mountvirtfs +# Required-Start: mountkernfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mount special file systems under /dev. +# Description: Mount the virtual filesystems the kernel provides +# that ordinarily live under the /dev filesystem. +### END INIT INFO + +PATH=/lib/init:/sbin:/bin +TTYGRP=5 +TTYMODE=620 +[ -f /etc/default/devpts ] && . /etc/default/devpts + +TMPFS_SIZE= +[ -f /etc/default/tmpfs ] && . /etc/default/tmpfs + +KERNEL="$(uname -s)" + +. /lib/lsb/init-functions +. /lib/init/mount-functions.sh + +do_start () { + # + # Mount a tmpfs on /dev/shm + # + SHM_OPT= + [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE" + domount tmpfs shmfs /dev/shm $SHM_OPT + + # + # Mount /dev/pts. Create master ptmx node if needed. + # + domount devpts "" /dev/pts -ogid=$TTYGRP,mode=$TTYMODE + + # + # Magic to make /proc/bus/usb work + # + [ -d /dev/bus/usb/.usbfs ] || mkdir -p /dev/bus/usb/.usbfs + domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644 + ln -s .usbfs/devices /dev/bus/usb/devices + mount --rbind /dev/bus/usb /proc/bus/usb +} + +case "$1" in + "") + echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2 + do_start + ;; + start) + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: mountdevsubfs [start|stop]" >&2 + exit 3 + ;; +esac --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/sendsigs +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/sendsigs @@ -0,0 +1,45 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: sendsigs +# Required-Start: +# Required-Stop: +# Default-Start: 6 +# Default-Stop: +# Short-Description: Kill all remaining processes. +# Description: +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin + +. /lib/lsb/init-functions + +do_stop () { + # Kill all processes. + log_action_begin_msg "Terminating all remaining processes" + killall5 -15 + log_action_end_msg 0 + sleep 5 + log_action_begin_msg "Sending all processes the KILL signal" + killall5 -9 + log_action_end_msg 0 +} + +case "$1" in + start) + # No-op + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + do_stop + usplash_down + ;; + *) + echo "Usage: $0 start|stop" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/mountkernfs.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/mountkernfs.sh @@ -0,0 +1,53 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mountkernfs +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mount kernel virtual file systems. +# Description: Mount initial set of virtual filesystems the kernel +# provides and that are required by everything. +### END INIT INFO + +PATH=/lib/init:/sbin:/bin + +. /lib/lsb/init-functions +. /lib/init/mount-functions.sh + +do_start () { + # + # Mount proc filesystem on /proc + # + domount proc "" /proc -onodev,noexec,nosuid + + # + # Mount sysfs on /sys + # + domount sysfs "" /sys -onodev,noexec,nosuid + + # Mount /var/run and /var/lock as tmpfs. + domount tmpfs "" /var/run -omode=0755,nodev,noexec,nosuid + domount tmpfs "" /var/lock -omode=1777,nodev,noexec,nosuid +} + +case "$1" in + "") + echo "Warning: mountvirtfs should be called with the 'start' argument." >&2 + do_start + ;; + start) + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: mountvirtfs [start|stop]" >&2 + exit 3 + ;; +esac --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/umountnfs.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/umountnfs.sh @@ -0,0 +1,93 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: umountnfs +# Required-Start: sendsigs +# Required-Stop: +# Default-Start: 6 +# Default-Stop: +# Short-Description: Unmount all network filesystems except the root file system. +# Description: Also unmounts all virtual filesystems (proc, devfs, devpts, +# usbfs, sysfs) that are not mounted at the top level. +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +KERNEL="$(uname -s)" +RELEASE="$(uname -r)" +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +case "${KERNEL}:${RELEASE}" in + Linux:[01].*|Linux:2.[01].*) + FLAGS="" + ;; + Linux:2.[23].*|Linux:2.4.?|Linux:2.4.?-*|Linux:2.4.10|Linux:2.4.10-*) + FLAGS="-f" + ;; + *) + FLAGS="-f -l" + ;; +esac + +do_stop () { + # Write a reboot record to /var/log/wtmp before unmounting + halt -w + + # Remove bootclean flag files (precaution against symlink attacks) + rm -f /tmp/.clean /var/lock/.clean /var/run/.clean + + [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting remote and non-toplevel virtual filesystems" + + # + # Make list of points to unmount in reverse order of their creation + # + + exec 9<&0 &2 + exit 3 + ;; + stop|"") + do_stop + ;; + *) + echo "Usage: umountnfs.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/umountfs +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/umountfs @@ -0,0 +1,175 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: umountfs +# Required-Start: umountnfs urandom +# Required-Stop: +# Default-Start: 0 6 +# Default-Stop: +# Short-Description: Turn off swap and unmount all local file systems. +# Description: +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +umask 022 + +# Print in order of decreasing length +# +# Algorithm: Find and print longest argument, then call self +# to print remaining arguments in order of decreasing length +# +# This function runs at one tenth the speed of the sort program +# but we use the function because we don't want to rely on any +# programs in /usr/. +# +# N.B.: Arguments must not be null and must not contain whitespace +# +pioodl() { + [ "$1" ] || return 0 + ARGNUM=1 + ARGNUM_LONGEST=0 + ARGLENGTH_LONGEST=0 + for ARG in "$@" + do + ARGLENGTH="${#ARG}" + if [ "$ARGLENGTH" -gt "$ARGLENGTH_LONGEST" ] + then + ARGLENGTH_LONGEST="$ARGLENGTH" + ARGNUM_LONGEST="$ARGNUM" + fi + ARGNUM=$(($ARGNUM + 1)) + done + # The method of passing prevargs assumes that args can be + # delimited with spaces + ARGNUM=1 + PREVARGS="" + while [ "$ARGNUM" -lt "$ARGNUM_LONGEST" ] + do + PREVARGS="$PREVARGS $1" + shift + ARGNUM=$(($ARGNUM + 1)) + done + echo "$1" + shift + pioodl $PREVARGS "$@" +} + + +do_stop () { + exec 9<&0 /dev/null + log_action_end_msg $? + else + log_action_msg "Will now deactivate swap" + swapoff -a -v + ES=$? + if [ "$ES" = 0 ] + then + log_success_msg "Done deactivating swap." + else + log_failure_msg "Swap deactivation failed with error code ${ES}." + fi + fi + + # + # Unmount local filesystems + # + if [ "$REG_MTPTS" ] + then + REG_MTPTS="$(pioodl $REG_MTPTS)" + if [ "$VERBOSE" = no ] + then + log_action_begin_msg "Unmounting local filesystems" + umount -f -r -d $REG_MTPTS + log_action_end_msg $? + else + log_action_msg "Will now unmount local filesystems" + umount -f -v -r -d $REG_MTPTS + ES=$? + if [ "$ES" = 0 ] + then + log_success_msg "Done unmounting local filesystems." + else + log_failure_msg "Unmounting local filesystems failed with error code ${ES}." + fi + fi + 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 + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/mtab.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/mtab.sh @@ -0,0 +1,142 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mtab +# Required-Start: mountall +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Update mtab file. +# Description: Update the mount program's mtab file after +# all local filesystems have been mounted. +### END INIT INFO + +PATH=/lib/init:/sbin:/bin +TTYGRP=5 +TTYMODE=620 +[ -f /etc/default/devpts ] && . /etc/default/devpts + +TMPFS_SIZE= +[ -f /etc/default/tmpfs ] && . /etc/default/tmpfs + +KERNEL="$(uname -s)" + +. /lib/lsb/init-functions +. /lib/init/mount-functions.sh + +domtab () +{ + # Directory present? + if [ ! -d $2 ] + then + return + fi + + # Not mounted? + if ! mountpoint -q $2 + then + return + fi + + if [ -n "$3" ] + then + NAME="$3" + else + NAME="$1" + fi + + # Already recorded? + if ! grep -E -sq "^([^ ]+) +$2 +" /etc/mtab + then + mount -f -t $1 $OPTS $4 $NAME $2 + fi +} + +do_start () { + DO_MTAB="" + MTAB_PATH="$(readlink -f /etc/mtab || :)" + case "$MTAB_PATH" in + /proc/*) + # Assume that /proc/ is not writable + ;; + /*) + # Only update mtab if it is known to be writable + # Note that the touch program is in /usr/bin + #if ! touch "$MTAB_PATH" >/dev/null 2>&1 + #then + # return + #fi + ;; + "") + [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)" + if [ "$MTAB_PATH" ] + then + log_failure_msg "Cannot initialize ${MTAB_PATH}." + else + log_failure_msg "Cannot initialize /etc/mtab." + fi + ;; + *) + log_failure_msg "Illegal mtab location '${MTAB_PATH}'." + ;; + esac + + # + # Initialize mtab file if necessary + # + if [ ! -f /etc/mtab ] + then + :> /etc/mtab + chmod 644 /etc/mtab + fi + if selinux_enabled && which restorecon >/dev/null 2>&1 && [ -r /etc/mtab ] + then + restorecon /etc/mtab + fi + + # S01mountkernfs.sh + domtab proc /proc "proc" -onodev,noexec,nosuid + domtab sysfs /sys "sys" -onodev,noexec,nosuid + domtab tmpfs /var/run "varrun" -omode=0755,nodev,noexec,nosuid + domtab tmpfs /var/lock "varlock" -omode=1777,nodev,noexec,nosuid + domtab usbfs /proc/bus/usb "procbususb" + + # S10udev + domtab tmpfs /dev "udev" -omode=0755 + + # S02mountdevsubfs + SHM_OPT= + [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE" + domtab tmpfs /dev/shm "devshm" $SHM_OPT + domtab devpts /dev/pts "devpts" -ogid=$TTYGRP,mode=$TTYMODE + + # S07linux-restricted-modules-common + exec 9<&0 0&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: mountall-mtab.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/single +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/single @@ -0,0 +1,35 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: single +# Required-Start: $local_fs killprocs +# Required-Stop: +# Default-Start: 1 +# Default-Stop: +# Short-Description: executed by init(8) upon entering runlevel 1 (single). +### END INIT INFO + +PATH=/sbin:/bin + +. /lib/lsb/init-functions + +do_start () { + log_action_msg "Will now switch to single-user mode" + exec init -t1 S +} + +case "$1" in + start) + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: $0 start|stop" >&2 + exit 3 + ;; +esac --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/skeleton +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/skeleton @@ -0,0 +1,155 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: skeleton +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: Example initscript +# Description: This file should be used to construct scripts to be +# placed in /etc/init.d. +### END INIT INFO + +# Author: Foo Bar +# +# Please remove the "Author" lines above and replace them +# with your own name if you copy and modify this script. + +# Do NOT "set -e" + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/usr/sbin:/usr/bin:/sbin:/bin +DESC="Description of the service" +NAME=daemonexecutablename +DAEMON=/usr/sbin/$NAME +DAEMON_ARGS="--options args" +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Load the VERBOSE setting and other rcS variables +[ -f /etc/default/rcS ] && . /etc/default/rcS + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + $DAEMON_ARGS \ + || return 2 + # Add code here, if necessary, that waits for the process to be ready + # to handle requests from services started subsequently which depend + # on this one. As a last resort, sleep for some time. +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +# +# Function that sends a SIGHUP to the daemon/service +# +do_reload() { + # + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + # + start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME + return 0 +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + #reload|force-reload) + # + # If do_reload() is not implemented then leave this commented out + # and leave 'force-reload' as an alias for 'restart'. + # + #log_daemon_msg "Reloading $DESC" "$NAME" + #do_reload + #log_end_msg $? + #;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/hostname.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/hostname.sh @@ -0,0 +1,47 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: hostname +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Set hostname. +# Description: +### END INIT INFO + +PATH=/sbin:/bin + +. /lib/init/vars.sh +. /lib/lsb/init-functions + +do_start () { + [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)" + + # Keep current name if /etc/hostname is missing. + [ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)" + + # And set it to 'localhost' if no setting was found + [ -z "$HOSTNAME" ] && HOSTNAME=localhost + + [ "$VERBOSE" != no ] && log_action_begin_msg "Setting hostname to '$HOSTNAME'" + hostname "$HOSTNAME" + ES=$? + [ "$VERBOSE" != no ] && log_action_end_msg $ES +} + +case "$1" in + start|"") + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: hostname.sh [start|stop]" >&2 + exit 3 + ;; +esac --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/halt +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/halt @@ -0,0 +1,77 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: halt +# Required-Start: umountroot +# Required-Stop: +# Should-Start: lvm raid2 +# Should-Stop: +# Default-Start: 0 +# Default-Stop: +# Short-Description: Execute the halt command. +# Description: +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +[ -f /etc/default/halt ] && . /etc/default/halt + +. /lib/lsb/init-functions + +do_stop () { + if [ "$INIT_HALT" = "" ] + then + case "$HALT" in + [Pp]*) + INIT_HALT=POWEROFF + ;; + [Hh]*) + INIT_HALT=HALT + ;; + *) + INIT_HALT=POWEROFF + ;; + esac + fi + + # See if we need to cut the power. + if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ] + then + /etc/init.d/ups-monitor poweroff + fi + + # Don't shut down drives if we're using RAID. + hddown="-h" + if grep -qs '^md.*active' /proc/mdstat + then + hddown="" + fi + + # If INIT_HALT=HALT don't poweroff. + poweroff="-p" + if [ "$INIT_HALT" = "HALT" ] + then + poweroff="" + fi + + log_action_msg "Will now halt" + sleep 1 + halt -d -f -i $poweroff $hddown +} + +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 + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/bootmisc.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/bootmisc.sh @@ -0,0 +1,92 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: bootmisc +# Required-Start: $local_fs hostname $remote_fs +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: +# Short-Description: Miscellaneous things to be done during bootup. +# Description: +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +[ "$DELAYLOGIN" ] || DELAYLOGIN=yes +. /lib/init/vars.sh + +do_start () { + # + # If login delaying is enabled then create the flag file + # which prevents logins before startup is complete + # + case "$DELAYLOGIN" in + Y*|y*) + echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin + ;; + esac + + # Create /var/run/utmp so we can login. + : > /var/run/utmp + if grep -q ^utmp: /etc/group + then + chmod 664 /var/run/utmp + chgrp utmp /var/run/utmp + fi + + # Set pseudo-terminal access permissions. + if [ ! -e /dev/.devfsd ] && [ -c /dev/ttyp0 ] + then + chmod -f 666 /dev/tty[p-za-e][0-9a-f] + chown -f root:tty /dev/tty[p-za-e][0-9a-f] + fi + + # Update motd + uname -snrvm > /var/run/motd + [ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd + + # Save kernel messages in /var/log/dmesg + if which dmesg >/dev/null 2>&1 + then + savelog -q -p -c 5 /var/log/dmesg + dmesg -s 524288 > /var/log/dmesg + chgrp adm /var/log/dmesg || : + elif [ -c /dev/klog ] + then + savelog -q -p -c 5 /var/log/dmesg + dd if=/dev/klog of=/var/log/dmesg & + sleep 1 + kill $! + [ -f /var/log/dmesg ] && { chgrp adm /var/log/dmesg || : ; } + fi + + # + # Save udev log in /var/log/udev + # + if [ -e /dev/.udev.log ] + then + mv -f /dev/.udev.log /var/log/udev + fi + + + # Remove bootclean's flag files. + # Don't run bootclean again after this! + rm -f /tmp/.clean +} + +case "$1" in + start|"") + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: bootmisc.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/reboot +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/reboot @@ -0,0 +1,39 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: reboot +# Required-Start: umountroot $network +# Required-Stop: +# Should-Start: lvm raid2 +# Default-Start: 6 +# Default-Stop: +# Short-Description: Execute the reboot command. +# Description: +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin + +. /lib/lsb/init-functions + +do_stop () { + # Message should end with a newline since kFreeBSD may + # print more stuff (see #323749) + log_action_msg "Will now restart" + reboot -d -f -i +} + +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 --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/checkroot.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/checkroot.sh @@ -0,0 +1,409 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: checkroot +# Required-Start: mountdevsubfs +# Required-Stop: +# Should-Start: keymap hwclockfirst +# Should-stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Check to root file system. +### END INIT INFO + +PATH=/lib/init:/sbin:/bin +FSCK_LOGFILE=/var/log/fsck/checkroot +[ "$FSCKFIX" ] || FSCKFIX=no +[ "$SULOGIN" ] || SULOGIN=no +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +# Always output fsck progress +stdin=`readlink /proc/self/fd/0` +if [ "${stdin#/dev/null}" != "$stdin" ]; then + exec /dev/console 2>&1 +fi + +do_start () { + # + # Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to + # be spawned from this script *before anything else* with a timeout, + # like sysv does. + # + [ "$SULOGIN" = yes ] && sulogin -t 30 $CONSOLE + + KERNEL="$(uname -s)" + MACHINE="$(uname -m)" + + # + # 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, + # 3) The mount parameters for a devfs filesystem. + # + + exec 9<&0 /dev/null 2>&1 + then + DEV="$(findfs "$DEV")" + fi + ;; + /*) + [ "$FSTYPE" = "swap" ] && swap_on_file=yes + ;; + *) + # Devfs definition ? + if [ "$FSTYPE" = "devfs" ] && [ "$MTPT" = "/dev" ] && mountpoint -q /dev + then + devfs="-t $FSTYPE $DEV $MTPT" + fi + ;; + esac + [ "$MTPT" != "/" ] && continue + rootdev="$DEV" + fstabroot="$DEV" + rootopts="$OPTS" + roottype="$FSTYPE" + ( [ "$PASS" != 0 ] && [ "$PASS" != "" ] ) && rootcheck=yes + ( [ "$FSTYPE" = "nfs" ] || [ "$FSTYPE" = "nfs4" ] ) && rootcheck=no + case "$OPTS" in + ro|ro,*|*,ro|*,ro,*) + rootmode=ro + ;; + esac + done + + exec 0<&9 9<&- + + # + # Activate the swap device(s) in /etc/fstab. This needs to be done + # before fsck, since fsck can be quite memory-hungry. + # + ENABLE_SWAP=no + case "$KERNEL" in + Linux) + if [ "$swap_on_lv" = yes ] + then + [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on logical volume." + elif [ "$swap_on_file" = yes ] + then + [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on swapfile." + else + ENABLE_SWAP=yes + fi + ;; + *) + ENABLE_SWAP=yes + ;; + esac + if [ "$ENABLE_SWAP" = yes ] + then + if [ "$VERBOSE" = no ] + then + log_action_begin_msg "Activating swap" + swapon -a -e >/dev/null 2>&1 + log_action_end_msg $? + else + log_action_msg "Will now activate swap" + swapon -a -v + ES=$? + if [ "$ES" = 0 ] + then + log_success_msg "Done activating swap." + else + log_failure_msg "Swap activation failed with error code ${ES}." + fi + fi + fi + + # + # 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 /dev/shm. + # + if [ "$rootcheck" = yes ] + then + ddev="$(mountpoint -qx $rootdev)" + rdev="$(mountpoint -d /)" + if [ "$ddev" != "$rdev" ] && [ "$ddev" != "4:0" ] + then + if [ "$(mountpoint -qx /dev/root)" = "4:0" ] + then + rootdev=/dev/root + else + if \ + rm -f /dev/shm/root \ + && mknod -m 600 /dev/shm/root b ${rdev%:*} ${rdev#*:} \ + && [ -e /dev/shm/root ] + then + rootdev=/dev/shm/root + else + rootfatal=yes + fi + fi + fi + fi + + # + # Bother, said Pooh. + # + if [ "$rootfatal" = yes ] + 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 /dev/shm. +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." + # Start a single user shell on the console + if ! sulogin $CONSOLE + then + log_failure_msg "Attempt to start maintenance shell failed. +Will restart in 5 seconds." + sleep 5 + fi + [ "$VERBOSE" = no ] || log_action_msg "Will now restart" + reboot -f + fi + + # See if we're on AC Power + # If not, we're not gonna run our check + if which on_ac_power >/dev/null 2>&1 && [ "$rootcheck" = yes ] + then + on_ac_power >/dev/null 2>&1 + if [ "$?" -eq 1 ] + then + log_warning_msg "On battery power, so skipping file system check." + rootcheck=no + fi + fi + + # + # See if we want to check the root file system. + # + FSCKCODE=0 + if [ -f /fastboot ] + then + [ "$rootcheck" = yes ] && log_warning_msg "Fast boot enabled, so skipping file system check." + rootcheck=no + fi + + if [ "$rootcheck" = yes ] + then + # + # Ensure that root is quiescent and read-only before fsck'ing. + # + # mount -n -o remount,ro / would be the correct syntax but + # mount can get confused when there is a "bind" mount defined + # in fstab that bind-mounts "/" somewhere else. + # + # So we use mount -n -o remount,ro $rootdev / but that can + # fail on older kernels on sparc64/alpha architectures due + # to a bug in sys_mount(). + # + # As a compromise we try both. + # + if \ + ! mount -n -o remount,ro $rootdev / \ + && ! mount -n -o remount,ro -t dummytype $rootdev / 2>/dev/null \ + && ! mount -n -o remount,ro / 2>/dev/null + then + log_failure_msg "Cannot check root file system because it is not mounted read-only." + rootcheck=no + fi + fi + + # + # The actual checking is done here. + # + if [ "$rootcheck" = yes ] + then + if [ -f /forcefsck ] + then + force="-f" + else + force="" + fi + + if [ "$FSCKFIX" = yes ] + then + fix="-y" + else + fix="-a" + fi + + spinner="-C" + case "$TERM" in + dumb|network|unknown|"") + spinner="" ;; + esac + # This Linux/s390 special case should go away. + if [ "${KERNEL}:${MACHINE}" = Linux:s390 ] + then + spinner="" + fi + + if [ "$VERBOSE" = no ] + then + log_action_begin_msg "Checking root file system" + logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -t $roottype $rootdev + FSCKCODE=$? + if [ "$FSCKCODE" = 0 ] + then + log_action_end_msg 0 + else + log_action_end_msg 1 "code $FSCKCODE" + fi + else + log_action_msg "Will now check root file system" + logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev + FSCKCODE=$? + if [ "$FSCKCODE" = 0 ] + then + log_success_msg "Done checking root file system. +A log will be saved in ${FSCK_LOGFILE} if that location is writable." + else + log_failure_msg "Root file system check failed with error code ${FSCKCODE}. +A log is being saved in ${FSCK_LOGFILE} if that location is writable." + fi + fi + fi + + # + # If there was a failure, drop into single-user mode. + # + # NOTE: "failure" is defined as exiting with a return code of + # 4 or larger. A return code of 1 indicates that file system + # errors were corrected but that the boot may proceed. A return + # code of 2 or 3 indicates that the system should immediately reboot. + # + if [ "$FSCKCODE" -gt 3 ] + then + # Surprise! Re-directing from a HERE document (as in "cat << EOF") + # does not work because the root is currently read-only. + log_failure_msg "An automatic file system check (fsck) of the root filesystem failed. +A manual fsck must be performed, then the system restarted. +The fsck should be performed in maintenance mode with the +root filesystem mounted in read-only mode." + log_warning_msg "The root filesystem is currently mounted in read-only mode. +A maintenance shell will now be started. +After performing system maintenance, press CONTROL-D +to terminate the maintenance shell and restart the system." + # Start a single user shell on the console + if ! sulogin $CONSOLE + then + log_failure_msg "Attempt to start maintenance shell failed. +Will restart in 5 seconds." + sleep 5 + fi + [ "$VERBOSE" = no ] || log_action_msg "Will now restart" + reboot -f + elif [ "$FSCKCODE" -gt 1 ] + then + log_failure_msg "The file system check corrected errors on the root partition +but requested that the system be restarted." + log_warning_msg "The system will be restarted in 5 seconds." + sleep 5 + [ "$VERBOSE" = no ] || log_action_msg "Will now restart" + reboot -f + fi + + # + # Remount root to final mode (rw or ro). + # + # See the comments above at the previous "mount -o remount" + # for an explanation why we try this twice. + # + if ! mount -n -o remount,$rootopts,$rootmode $fstabroot / 2>/dev/null + then + mount -n -o remount,$rootopts,$rootmode / + fi + + # + # We only create/modify /etc/mtab if the location where it is + # stored is writable. If /etc/mtab is a symlink into /proc/ + # then it is not writable. + # + INIT_MTAB_FILE=no + MTAB_PATH="$(readlink -f /etc/mtab || :)" + case "$MTAB_PATH" in + /proc/*) + ;; + /*) + if touch "$MTAB_PATH" >/dev/null 2>&1 + then + :> "$MTAB_PATH" + rm -f ${MTAB_PATH}~ + INIT_MTAB_FILE=yes + fi + ;; + "") + [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)" + if [ "$MTAB_PATH" ] + then + log_failure_msg "Cannot initialize ${MTAB_PATH}." + else + log_failure_msg "Cannot initialize /etc/mtab." + fi + ;; + *) + log_failure_msg "Illegal mtab location '${MTAB_PATH}'." + ;; + esac + + if [ "$INIT_MTAB_FILE" = yes ] + then + [ "$roottype" != none ] && + mount -f -o $rootopts -t $roottype $fstabroot / + [ "$devfs" ] && mount -f $devfs + fi + + # + # Remove /dev/shm/root if we created it. + # + rm -f /dev/shm/root +} + +case "$1" in + start|"") + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: checkroot.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/umountroot +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/umountroot @@ -0,0 +1,48 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: umountroot +# Required-Start: umountfs +# Required-Stop: umountfs +# Default-Start: 6 +# Default-Stop: +# Short-Description: Mount the root filesystem read-only. +### END INIT INFO + +PATH=/sbin:/bin +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +do_stop () { + [ "$VERBOSE" = no ] || log_action_begin_msg "Mounting root filesystem read-only" + MOUNT_FORCE_OPT= + [ "$(uname -s)" = "GNU/kFreeBSD" ] && MOUNT_FORCE_OPT=-f + # This: + # mount -n -o remount,ro / + # will act on a bind mount of / if there is one. + # See #339023 and the comment in checkroot.sh + mount $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev / 2>/dev/null \ + || mount $MOUNT_FORCE_OPT -n -o remount,ro dummydev / 2>/dev/null \ + || mount $MOUNT_FORCE_OPT -n -o remount,ro / + ES=$? + [ "$VERBOSE" = no ] || log_action_end_msg $ES +} + +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 + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/rmnologin +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/rmnologin @@ -0,0 +1,48 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: rmnologin +# Required-Start: $local_fs $remote_fs +# Required-Stop: +# Should-Start: kdm xdm gdm $syslog +# Default-Start: 0 1 2 3 4 5 6 +# Default-Stop: +# Short-Description: Remove /etc/nologin at boot +# Description: This script removes the /etc/nologin file as the +# last step in the boot process, if DELAYLOGIN=yes. +# If DELAYLOGIN=no, /etc/nologin was not created by +# bootmisc earlier in the boot process. +### END INIT INFO + +PATH=/sbin:/bin +[ "$DELAYLOGIN" ] || DELAYLOGIN=yes +. /lib/init/vars.sh + +do_start () { + # + # If login delaying is enabled then remove the flag file + # + case "$DELAYLOGIN" in + Y*|y*) + rm -f /var/lib/initscripts/nologin + ;; + esac +} + +case "$1" in + start) + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: $0 start|stop" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/mountall.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/mountall.sh @@ -0,0 +1,111 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mountall +# Required-Start: checkfs +# Required-Stop: +# Should-Start: lvm +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mount all filesystems. +# Description: +### END INIT INFO + +PATH=/sbin:/bin +. /lib/init/vars.sh + +. /lib/lsb/init-functions +. /lib/init/mount-functions.sh + +do_start() { + # + # Mount local file systems in /etc/fstab. + # + pre_mountall + if [ "$VERBOSE" = no ] + then + log_action_begin_msg "Mounting local filesystems" + mount -a -t proc >/dev/null 2>&1 # Ignore error message due to /proc already being mounted + ES_TO_REPORT=$? + mount -a -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs + ES=$? + ES_TO_REPORT=$(($ES_TO_REPORT | $ES)) + if [ 0 = "$ES_TO_REPORT" ] + then + log_action_end_msg 0 + else + log_action_end_msg 1 "code $ES_TO_REPORT" + fi + else + log_action_msg "Will now mount local filesystems" + mount -a -t proc >/dev/null 2>&1 # Ignore error message due to /proc already being mounted + ES=$? + [ 0 = "$ES" ] || log_failure_msg "Mounting proc filesystems failed with error code ${ES}." + mount -a -v -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs + ES=$? + if [ 0 = "$ES" ] + then + log_success_msg "Done mounting local filesystems." + else + log_failure_msg "Mounting local filesystems failed with error code ${ES}." + fi + fi + + post_mountall + + case "$(uname -s)" in + *FreeBSD) + INITCTL=/etc/.initctl + ;; + *) + INITCTL=/dev/initctl + ;; + esac + + # + # We might have mounted something over /dev, see if + # /dev/initctl is there. + # + if [ ! -p $INITCTL ] + then + rm -f $INITCTL + mknod -m 600 $INITCTL p + fi + kill -USR1 1 + + # + # Execute swapon command again, in case we want to swap to + # a file on a now mounted filesystem. + # + # Ignore 255 status due to swap already being enabled + # + if [ "$VERBOSE" = no ] + then + log_action_begin_msg "Activating swapfile swap" + swapon -a -e 2>/dev/null || : # Stifle "Device or resource busy" + log_action_end_msg 0 + else + log_action_msg "Will now activate swapfile swap" + swapon -a -e -v || : + log_success_msg "Done activating swapfile swap." + fi +} + +case "$1" in + start|"") + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: mountall.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/urandom +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/urandom @@ -0,0 +1,65 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: urandom +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Save and restore random seed between restarts. +# Description This script saves the random seed between restarts. +# It is called from the boot, halt and reboot scripts. +### END INIT INFO + +[ -c /dev/urandom ] || exit 0 + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +SAVEDFILE=/var/lib/urandom/random-seed +POOLSIZE=512 +[ -f /proc/sys/kernel/random/poolsize ] && POOLSIZE="$(cat /proc/sys/kernel/random/poolsize)" +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +case "$1" in + start|"") + [ "$VERBOSE" = no ] || log_action_begin_msg "Initializing random number generator" + # Load and then save $POOLSIZE bytes, + # which is the size of the entropy pool + if [ -f "$SAVEDFILE" ] + then + # Handle locally increased pool size + SAVEDSIZE="$(find "$SAVEDFILE" -printf "%s")" + if [ "$SAVEDSIZE" -gt "$POOLSIZE" ] + then + [ -w /proc/sys/kernel/random/poolsize ] && echo $POOLSIZE > /proc/sys/kernel/random/poolsize + POOLSIZE=$SAVEDSIZE + fi + cat "$SAVEDFILE" >/dev/urandom + fi + rm -f $SAVEDFILE + umask 077 + dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1 + ES=$? + umask 022 + [ "$VERBOSE" = no ] || log_action_end_msg $ES + ;; + stop) + # Carry a random seed from shut-down to start-up; + # see documentation in linux/drivers/char/random.c + [ "$VERBOSE" = no ] || log_action_begin_msg "Saving random seed" + umask 077 + dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1 + ES=$? + [ "$VERBOSE" = no ] || log_action_end_msg $ES + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + *) + echo "Usage: urandom start|stop" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/waitnfs.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/waitnfs.sh @@ -0,0 +1,99 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: waitnfs +# Required-Start: $network $local_fs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Wait for network file systems to be mounted +# Description: Network file systems are mounted in the background when +# interfaces are brought up; this script waits for them +# to be mounted before carrying on. +### END INIT INFO + +[ -f /etc/default/rcS ] && . /etc/default/rcS +. /lib/lsb/init-functions + +do_start() { + [ -f /etc/fstab ] || return + # + # Read through fstab line by line. If it is NFS, set the flag + # for mounting NFS file systems. If any NFS partition is found + # then wait around for it. + # + + exec 9<&0 &2 + exit 3 + ;; + stop) + ;; + *) + echo "Usage: $0 start|stop" >&2 + exit 3 + ;; +esac + +: exit 0 --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/bootlogd +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/bootlogd @@ -0,0 +1,92 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: bootlogd +# Required-Start: mountdevsubfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start or stop bootlogd. +# Description: Starts or stops the bootlogd log program +# which logs boot messages. +### END INIT INFO + +PATH=/sbin:/bin +DAEMON=/sbin/bootlogd +[ -x "$DAEMON" ] || exit 0 +NAME=bootlogd +DESC="boot logger" +BOOTLOGD_OPTS="-r -c" +[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +# Because bootlogd is broken on some systems, we take the special measure +# of requiring it to be enabled by setting an environment variable. +case "$BOOTLOGD_ENABLE" in + [Nn]*) + exit 0 + ;; +esac + +# Previously this script was symlinked as "stop-bootlogd" which, when run +# with the "start" argument, should stop bootlogd. Now stop-bootlogd is +# a distinct script, but for backward compatibility this script continues +# to implement the old behavior. +SCRIPTNAME=${0##*/} +SCRIPTNAME=${SCRIPTNAME#[SK]??} +ACTION="$1" +case "$0" in + *stop-bootlog*) + [ "$ACTION" = start ] && ACTION=stop + ;; +esac + +case "$ACTION" in + start) + # PATH is set above + log_daemon_msg "Starting $DESC" "$NAME" + if [ -d /proc/1/. ] + then + umask 027 + start-stop-daemon --start --quiet --exec $DAEMON -- \ + $BOOTLOGD_OPTS + ES=$? + else + $DAEMON $BOOTLOGD_OPTS + ES=$? + fi + log_end_msg $ES + ;; + stop) + PATH=/sbin:/bin:/usr/sbin:/usr/bin + log_daemon_msg "Stopping $DESC" "$NAME" + start-stop-daemon --stop --quiet --exec $DAEMON + ES=$? + sleep 1 + log_end_msg $ES + if [ -f /var/log/boot ] && [ -f /var/log/boot~ ] + then + [ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log file" + # bootlogd writes to boot, making backup at boot~ + cd /var/log && { + chgrp adm boot || : + savelog -q -p -c 5 boot \ + && mv boot.0 boot \ + && mv boot~ boot.0 + } + ES=$? + [ "$VERBOSE" = no ] || log_action_end_msg $ES + fi + ;; + restart|force-reload) + /etc/init.d/bootlogd stop + /etc/init.d/bootlogd start + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/rc.local +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/rc.local @@ -0,0 +1,29 @@ +#! /bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +[ -f /etc/default/rcS ] && . /etc/default/rcS +. /lib/lsb/init-functions + +do_start() { + if [ -x /etc/rc.local ]; then + log_begin_msg "Running local boot scripts (/etc/rc.local)" + /etc/rc.local + log_end_msg $? + fi +} + +case "$1" in + start) + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + ;; + *) + echo "Usage: $0 start|stop" >&2 + exit 3 + ;; +esac --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/stop-bootlogd-single +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/stop-bootlogd-single @@ -0,0 +1,34 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: stop-bootlogd-single +# Required-Start: $remote_fs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Stop bootlogd in single user mode +# Description: See the bootlogd script +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +NAME=stop-bootlogd-single +DAEMON=/sbin/bootlogd + +[ -x "$DAEMON" ] || exit 0 + +case "$1" in + start) + if [ ! -e /proc/cmdline ] || grep -q '\' /proc/cmdline + then + /etc/init.d/bootlogd stop + fi + ;; + stop|restart|force-reload) + # No-op + ;; + *) + echo "Usage: $NAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/stop-bootlogd +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/stop-bootlogd @@ -0,0 +1,30 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: stop-bootlogd +# Required-Start: $remote_fs +# Required-Stop: +# Default-Start: 1 2 3 4 5 +# Default-Stop: +# Short-Description: Stop bootlogd +# Description: See the bootlogd script +### END INIT INFO + +NAME=stop-bootlogd +DAEMON=/sbin/bootlogd + +[ -x "$DAEMON" ] || exit 0 + +case "$1" in + start) + /etc/init.d/bootlogd stop + ;; + stop|restart|force-reload) + # No-op + ;; + *) + echo "Usage: $NAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/mountall-bootclean.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/mountall-bootclean.sh @@ -0,0 +1,31 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mountall-bootclean +# Required-Start: mountall +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: bootclean after mountall. +# Description: Clean temporary filesystems after +# all local filesystems have been mounted. +### END INIT INFO + +case "$1" in + start|"") + # Clean /tmp, /var/lock, /var/run + /etc/init.d/bootclean + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: mountall-bootclean.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/killprocs +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/killprocs @@ -0,0 +1,51 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: killprocs +# Required-Start: $local_fs +# Required-Stop: +# Default-Start: 1 +# Default-Stop: +# Short-Description: executed by init(8) upon entering runlevel 1 (single). +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin + +. /lib/lsb/init-functions + +do_start () { + # Kill all processes. + log_action_begin_msg "Sending all processes the TERM signal" + killall5 -15 + log_action_end_msg 0 + sleep 5 + log_action_begin_msg "Sending all processes the KILL signal" + killall5 -9 + log_action_end_msg 0 + + # We start update here, since we just killed it. + if [ -x /sbin/update ] && [ "$(uname -s)" = Linux ] + then + case "$(uname -r)" in + 0.*|1.*|2.[0123].*) + /sbin/update + ;; + esac + fi +} + +case "$1" in + start) + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: $0 start|stop" >&2 + exit 3 + ;; +esac --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/mountnfs-bootclean.sh +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/mountnfs-bootclean.sh @@ -0,0 +1,31 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mountnfs-bootclean +# Required-Start: mountnfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: bootclean after mountnfs. +# Description: Clean temporary filesystems after +# network filesystems have been mounted. +### END INIT INFO + +case "$1" in + start|"") + # Clean /tmp, /var/lock, /var/run + /etc/init.d/bootclean + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: mountnfs-bootclean.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/bootclean +++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/bootclean @@ -0,0 +1,145 @@ +#!/bin/sh +# +# bootclean +# +# Clean /tmp +# +# DO NOT RUN AFTER S:55bootmisc.sh and do not run this script directly +# in runlevel S. Instead write an initscript to call it. +# + +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +# Should be called outside verbose message block +mkflagfile() +{ + # Prevent symlink attack (See #264234.) + [ -L "$1" ] && log_warning_msg "bootclean: Deleting symbolic link '$1'." + rm -f "$1" || { log_failure_msg "bootclean: Failure deleting '$1'." ; return 1 ; } + # No user processes should be running, so no one should be able to introduce + # a symlink here. As an extra precaution, set noclobber. + set -o noclobber + :> "$1" || { log_failure_msg "bootclean: Failure creating '$1'." ; return 1 ; } + return 0 +} + +clean_tmp() { + cd /tmp || { log_failure_msg "bootclean: Could not cd to /tmp." ; return 1 ; } + + # + # Only clean out /tmp if it is world-writable. This ensures + # it really is a/the temp directory we're cleaning. + # + [ "$(find . -maxdepth 0 -perm -002)" = "." ] || return 0 + + if [ ! "$TMPTIME" ] + then + log_warning_msg "Using default TMPTIME 0." + TMPTIME=0 + fi + + [ "$VERBOSE" = no ] || log_action_begin_msg "Cleaning /tmp" + + # + # Remove regardless of TMPTIME setting + # + rm -f .X*-lock + + # + # Don't clean remaining files if TMPTIME is negative or 'infinite' + # + case "$TMPTIME" in + -*|infinite|infinity) + [ "$VERBOSE" = no ] || log_action_end_msg 0 "skipped" + return 0 + ;; + esac + + # + # Wipe /tmp, excluding system files, but including lost+found + # + # If TMPTIME is set to 0, we do not use any ctime expression + # at all, so we can also delete files with timestamps + # in the future! + # + if [ "$TMPTIME" = 0 ] + then + TEXPR="" + DEXPR="" + else + TEXPR="-mtime +$TMPTIME -ctime +$TMPTIME -atime +$TMPTIME" + DEXPR="-mtime +$TMPTIME -ctime +$TMPTIME" + fi + + EXCEPT='! -name . + ! ( -path ./lost+found -uid 0 ) + ! ( -path ./quota.user -uid 0 ) + ! ( -path ./aquota.user -uid 0 ) + ! ( -path ./quota.group -uid 0 ) + ! ( -path ./aquota.group -uid 0 ) + ! ( -path ./.journal -uid 0 ) + ! ( -path ./.clean -uid 0 ) + ! ( -path './...security*' -uid 0 )' + + mkflagfile /tmp/.clean || return 1 + + report_err() + { + if [ "$VERBOSE" = no ] + then + log_failure_msg "bootclean: Failure cleaning /tmp." + else + log_action_end_msg 1 "bootclean: Failure cleaning /tmp" + fi + } + + # + # First remove all old files... + # (Use xargs here so that only one additional process gets created) + # + find . -depth -xdev $TEXPR $EXCEPT ! -type d \ + -print0 | xargs -0r rm -f -- \ + || { report_err ; return 1 ; } + + # + # ...and then all empty directories + # (Don't use xargs here because dirs must be removed one by one from + # the bottom up) + # + find . -depth -xdev $DEXPR $EXCEPT -type d -empty \ + -exec rmdir \{\} \; \ + || { report_err ; return 1 ; } + + [ "$VERBOSE" = no ] || log_action_end_msg 0 + return 0 +} + +which find >/dev/null 2>&1 || exit 1 +which xargs >/dev/null 2>&1 || exit 1 + +# If there are flag files that have not been created by root +# then remove them +for D in /tmp +do + if [ -f $D/.clean ] + then + which stat >/dev/null 2>&1 && cleanuid="$(stat -c %u $D/.clean)" + # Poor's man stat %u, since stat (and /usr) might not be + # available in some bootup stages + [ "$cleanuid" ] || cleanuid="$(find $D/.clean -printf %U)" + [ "$cleanuid" ] || { log_failure_msg "bootclean: Could not stat '$D/.clean'." ; exit 1 ; } + if [ "$cleanuid" -ne 0 ] + then + rm -f $D/.clean || { log_failure_msg "bootclean: Could not delete '$D/.clean'." ; exit 1 ; } + fi + fi +done + +[ -f /tmp/.clean ] && exit 0 + +ES=0 +[ -d /tmp ] && ! [ -f /tmp/.clean ] && { clean_tmp || ES=1 ; } +exit $ES + --- sysvinit-2.86.ds1.orig/debian/initscripts/etc/network/if-up.d/mountnfs +++ sysvinit-2.86.ds1/debian/initscripts/etc/network/if-up.d/mountnfs @@ -0,0 +1,135 @@ +#! /bin/sh +# Description: Now that TCP/IP is configured, mount the NFS file +# systems in /etc/fstab if needed. If possible, +# start the portmapper before mounting (this is needed for +# Linux 2.1.x and up). +# +# Also mounts SMB filesystems now, so the name of +# this script is getting increasingly inaccurate. + +PATH=/sbin:/bin +. /lib/init/vars.sh + +. /lib/lsb/init-functions +. /lib/init/mount-functions.sh + +do_start() { + [ -f /etc/fstab ] || return + # + # Read through fstab line by line. If it is NFS, set the flag + # for mounting NFS file systems. If any NFS partition is found and it + # not mounted with the nolock option, we start the portmapper. + # + # If any sec={krb5,krb5i,krb5p} option is given, or any of the file + # systems are nfs4, we'll need to start rpc.gssd and/or rpc.idmapd too; + # we'll leave that to nfs-common. + # + + exec 9<&0 /dev/null 2>&1 + then + if [ -x /etc/init.d/portmap ] + then + /etc/init.d/portmap start + else + start-stop-daemon --start --quiet --oknodo --exec /sbin/portmap + sleep 1 # FIXME: Actually synchronize with the process? + fi + fi + fi + + # + # Initialize nfs-common (which starts rpc.gssd and/or rpc.idmapd, and loads + # the right kernel modules if applicable) if we use Kerberos and/or NFSv4 mounts. + # + if [ "$gss_or_idmap" = yes ] && [ -x /etc/init.d/nfs-common ] + then + /etc/init.d/nfs-common start + fi + + if [ "$NETFS" ] + then + mount_all_nfs() { mount -a -t$NETFS ; } + + # Accept 64 or 96 (32/mount failure + 64/some mount succeeded) + # as valid return statuses from mount. This partly works around + # the problem of mount reporting an error status when + # some filesystems are already mounted. + + pre_mountall + mount_all_nfs + post_mountall + fi +} + + +# Not for loopback! +[ "$IFACE" != "lo" ] || exit 0 + +# Lock around this otherwise insanity may occur +mkdir /var/run/network/mountnfs 2>/dev/null || exit 0 + +do_start + +rmdir /var/run/network/mountnfs 2>/dev/null || exit 0 --- sysvinit-2.86.ds1.orig/debian/initscripts/man/fsck.nfs.8 +++ sysvinit-2.86.ds1/debian/initscripts/man/fsck.nfs.8 @@ -0,0 +1,16 @@ +.TH FSCK.NFS 8 "May 2004" "Initscripts" +.SH NAME +fsck.nfs \- Dummy fsck.nfs script that always returns success. +.SH SYNOPSIS +.B fsck.nfs +.SH DESCRIPTION +Debian GNU/Linux need this for when the root file system is on NFS: there is +no way to find out if root is NFS mounted and we really want to do a +"fsck -a /". +.SH EXIT CODE +The exit code returned by +.B mount.nfs +is always zero, meaning successful completion. +.SH SEE ALSO +.BR fsck (8), +.BR fstab (5). --- sysvinit-2.86.ds1.orig/debian/initscripts/sbin/fsck.nfs +++ sysvinit-2.86.ds1/debian/initscripts/sbin/fsck.nfs @@ -0,0 +1,21 @@ +#! /bin/sh +# +# fsck.nfs +# +# Dummy fsck.nfs file that always returns success. We +# need this for when the root file system is on NFS: +# there is no way to find out if root is NFS mounted +# and we really want to do a "fsck -a /". +# + +while : +do + case "$1" in + -*) shift ;; + *) break ;; + esac +done + +echo "$1: NFS file system." + +exit 0 --- sysvinit-2.86.ds1.orig/debian/initscripts/lib/init/mount-functions.sh +++ sysvinit-2.86.ds1/debian/initscripts/lib/init/mount-functions.sh @@ -0,0 +1,138 @@ +# +# Functions used by several mount* scripts in initscripts package +# +# Sourcer must set PATH and include /lib/init in it because +# domount() uses the custom readlink program +# +# Sourcer must also source /lib/lsb/init-functions.sh + +# $1: directory +is_empty_dir() { + for FILE in $1/* $1/.* + do + case "$FILE" in + "$1/.*") return 0 ;; + "$1/*"|"$1/."|"$1/..") continue ;; + *) return 1 ;; + esac + done + return 0 +} + + +selinux_enabled () { + which selinuxenabled >/dev/null 2>&1 && selinuxenabled +} + + +# $1: file system type +# $2: alternative file system type (or empty string if none) +# $3: mount point +# $4... : extra mount program options +domount () { + MTPT="$3" + KERNEL="$(uname -s)" + # Figure out filesystem type + FSTYPE= + if [ "$1" = proc ] + then + case "$KERNEL" in + Linux|GNU) FSTYPE=proc ;; + *FreeBSD) FSTYPE=linprocfs ;; + *) FSTYPE=procfs ;; + esac + elif grep -E -qs "$1\$" /proc/filesystems + then + FSTYPE=$1 + elif grep -E -qs "$2\$" /proc/filesystems + then + FSTYPE=$2 + fi + + if [ ! "$FSTYPE" ] + then + if [ "$2" ] + then + log_warning_msg "Filesystem types '$1' and '$2' are not supported. Skipping mount." + else + log_warning_msg "Filesystem type '$1' is not supported. Skipping mount." + fi + return + fi + + # Get the options from /etc/fstab. + OPTS= + if [ -f /etc/fstab ] + then + exec 9<&0 /dev/null 2>&1 || log_warning_msg "Files under mount point '$MTPT' will be hidden." + fi + mount -n -t $FSTYPE $OPTS $4 $FSTYPE $MTPT +} + +# +# Preserve /var/run and /var/lock mountpoints +# +pre_mountall () +{ + # We may end up mounting something over top of /var, either directly + # or because /var is a symlink to something that's mounted. So keep + # copies of the /var/run and /var/lock mounts elsewhere on the root + # filesystem so they can be moved back. + mkdir /dev/shm/var.run /dev/shm/var.lock + mount -n --bind /var/run /dev/shm/var.run + mount -n --bind /var/lock /dev/shm/var.lock +} + +# +# Restore /var/run and /var/lock mountpoints +# +post_mountall () +{ + # Make sure the new filesystem has a /var/run and /var/lock + [ -d /var/run ] || mkdir /var/run + [ -d /var/lock ] || mkdir /var/lock + + # Move the mountpoints back. Fortunately mount seems to not care + # if these are the same thing (ie. /var didn't get changed) so we + # do this regardless + mount -n --move /dev/shm/var.run /var/run + mount -n --move /dev/shm/var.lock /var/lock + + # Clean up after ourselves + rmdir /dev/shm/var.run /dev/shm/var.lock +} --- sysvinit-2.86.ds1.orig/debian/initscripts/lib/init/vars.sh +++ sysvinit-2.86.ds1/debian/initscripts/lib/init/vars.sh @@ -0,0 +1,6 @@ +# +# Set rcS vars +# + +[ -f /etc/default/rcS ] && . /etc/default/rcS +[ "$INIT_VERBOSE" ] && VERBOSE="$INIT_VERBOSE" --- sysvinit-2.86.ds1.orig/debian/initscripts/doc/README.Debian +++ sysvinit-2.86.ds1/debian/initscripts/doc/README.Debian @@ -0,0 +1,25 @@ +tmpfs +----- + +Around kernel version 2.3.3x, a memory based filesystem was +introduced to support POSIX shared memory, called 'shmfs'. +Later this filesystem was extended for general usage and a +"tmpfs" could be mounted. The CONFIG_TMPFS kernel compile option +must be set to 'y', as it is for Debian kernels. + +Early in the 2.4 kernel series, shmfs was renamed to tmpfs, but +could be mounted using either 'shmfs' or 'tmpfs'. Starting with +kernel version 2.5.44, the 'shmfs' alias was dropped. + +Confusingly, in kernels 2.3.x - 2.5.43 where both "shmfs" and +"tmpfs" are present, disabling CONFIG_TMPFS actually removes +support for shmfs, but tmpfs is still listed in /proc/filesystems +to support SYSV and POSIX shared memory, and it should still be +mounted under /dev/shm. + +Recommendation: always enable CONFIG_TMPFS and always mount +using the tmpfs type. Forget about shmfs. + +Tmpfs can be used as memory filesystem, so you can limit tmpfs +max size using /etc/default/tmpfs to prevent tmpfs from using +up all system memory.