[Pkg-sysvinit-commits] r1126 - in sysvinit/trunk/debian: . initscripts initscripts/etc/init.d

pere at alioth.debian.org pere at alioth.debian.org
Thu Dec 27 08:20:12 UTC 2007


Author: pere
Date: 2007-12-27 08:20:11 +0000 (Thu, 27 Dec 2007)
New Revision: 1126

Added:
   sysvinit/trunk/debian/initscripts/etc/init.d/mountoverflowtmp
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/conffiles
   sysvinit/trunk/debian/initscripts/postinst
Log:
  * Mount a 1 MiB tmpfs on /tmp if /tmp is otherwise less than
    1 MiB to make sure one can still log in when /tmp/ is too
    full (Closes: #430814).  Based on patch from Ian Jackson and Ubuntu.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2007-12-26 23:44:55 UTC (rev 1125)
+++ sysvinit/trunk/debian/changelog	2007-12-27 08:20:11 UTC (rev 1126)
@@ -7,6 +7,9 @@
     should-start (Closes: #433359).
   * Change init.d/umountnfs.sh dependencies to list nfs-common in
     should-start too.
+  * Mount a 1 MiB tmpfs on /tmp if /tmp is otherwise less than
+    1 MiB to make sure one can still log in when /tmp/ is too
+    full (Closes: #430814).  Based on patch from Ian Jackson and Ubuntu.
 
  -- Petter Reinholdtsen <pere at debian.org>  Wed, 26 Dec 2007 23:04:56 +0100
 

Modified: sysvinit/trunk/debian/initscripts/conffiles
===================================================================
--- sysvinit/trunk/debian/initscripts/conffiles	2007-12-26 23:44:55 UTC (rev 1125)
+++ sysvinit/trunk/debian/initscripts/conffiles	2007-12-27 08:20:11 UTC (rev 1126)
@@ -11,6 +11,7 @@
 /etc/init.d/mountall-bootclean.sh
 /etc/init.d/mountnfs.sh
 /etc/init.d/mountnfs-bootclean.sh
+/etc/init.d/mountoverflowtmp
 /etc/init.d/mountdevsubfs.sh
 /etc/init.d/mountkernfs.sh
 /etc/init.d/mtab.sh

Added: sysvinit/trunk/debian/initscripts/etc/init.d/mountoverflowtmp
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountoverflowtmp	                        (rev 0)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountoverflowtmp	2007-12-27 08:20:11 UTC (rev 1126)
@@ -0,0 +1,55 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          mountoverflowtmp
+# Required-Start:    mountall-bootclean
+# Required-Stop:     $local_fs
+# Default-Start:     S
+# Default-Stop:      0 6
+# Short-Description: mount emergency /tmp.
+# Description:       Mount a tmpfs on /tmp if there would
+#                    otherwise be too little space to log in.
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+set -e
+
+defs=/etc/default/mountoverflowtmp
+test ! -f "$defs" || . "$defs"
+
+: ${MINTMPKB:=1024}
+if test "$MINTMPKB" = "0"; then exit 0; fi
+
+case "$1" in
+  start|"")
+	log_action_begin_msg "Checking minimum space in /tmp"
+	df="`df -kP /tmp |grep -v Filesystem`"
+	set -- $df
+	avail="$4"
+	log_action_end_msg 0
+	echo $avail
+	if test $avail -lt "$MINTMPKB"; then
+		log_action_begin_msg "Mounting emergency tmpfs on /tmp"
+		mount -t tmpfs -o size=1048576,mode=1777 overflow /tmp
+		log_action_end_msg 0
+	fi
+	;;
+  restart|reload|force-reload)
+	echo "Error: argument '$1' not supported" >&2
+	exit 3
+	;;
+  stop)
+	log_action_begin_msg "Unmounting any overflow tmpfs from /tmp"
+	if LANG=C LC_ALL=C mount | \
+		grep '^overflow on /tmp type tmpfs' >/dev/null; then
+		umount overflow
+	fi
+	log_action_end_msg 0
+	;;
+  *)
+	echo "Usage: mountoverflowtmp [start|stop]" >&2
+	exit 3
+	;;
+esac
+
+:

Modified: sysvinit/trunk/debian/initscripts/postinst
===================================================================
--- sysvinit/trunk/debian/initscripts/postinst	2007-12-26 23:44:55 UTC (rev 1125)
+++ sysvinit/trunk/debian/initscripts/postinst	2007-12-27 08:20:11 UTC (rev 1126)
@@ -123,6 +123,7 @@
 updatercd checkfs.sh             start 30 S .
 updatercd mountall.sh            start 35 S .
 updatercd mountall-bootclean.sh  start 36 S .
+updatercd mountoverflowtmp       start 37 S . stop 63 0 6 .
 updatercd mountnfs.sh            start 45 S .
 updatercd mountnfs-bootclean.sh  start 46 S .
 updatercd bootmisc.sh            start 55 S .




More information about the Pkg-sysvinit-commits mailing list