[Pkg-sysvinit-commits] r940 - in sysvinit/trunk/debian: .
initscripts initscripts/etc/init.d initscripts/lib/init
initscripts/share
Petter Reinholdtsen
pere at costa.debian.org
Tue Sep 19 14:32:31 UTC 2006
Author: pere
Date: 2006-09-19 14:32:31 +0000 (Tue, 19 Sep 2006)
New Revision: 940
Modified:
sysvinit/trunk/debian/changelog
sysvinit/trunk/debian/initscripts/etc/init.d/mountkernfs.sh
sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh
sysvinit/trunk/debian/initscripts/postinst
sysvinit/trunk/debian/initscripts/rcS.5
sysvinit/trunk/debian/initscripts/share/default.rcS
Log:
* Make the tmpfs on /var/run/ and /var/lock/ optional, and provide
TMPRUN and TMPLOCK options in /etc/default/rcS to control this.
Remove code to convert to this feature when the package is
upgraded or installed. It will take effect after a reboot if
/etc/default/rcS is modified. Keep them disabled for now.
Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog 2006-09-16 10:42:00 UTC (rev 939)
+++ sysvinit/trunk/debian/changelog 2006-09-19 14:32:31 UTC (rev 940)
@@ -1,3 +1,13 @@
+sysvinit (2.86.ds1-23~1) experimental; urgency=low
+
+ * Make the tmpfs on /var/run/ and /var/lock/ optional, and provide
+ TMPRUN and TMPLOCK options in /etc/default/rcS to control this.
+ Remove code to convert to this feature when the package is
+ upgraded or installed. It will take effect after a reboot if
+ /etc/default/rcS is modified. Keep them disabled for now.
+
+ -- Petter Reinholdtsen <pere at localhost> Tue, 19 Sep 2006 16:24:48 +0200
+
sysvinit (2.86.ds1-22) experimental; urgency=low
* Let mountdevsubfs provide mountvirtfs to work with init.d scripts
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountkernfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountkernfs.sh 2006-09-16 10:42:00 UTC (rev 939)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountkernfs.sh 2006-09-19 14:32:31 UTC (rev 940)
@@ -12,6 +12,7 @@
### END INIT INFO
PATH=/lib/init:/sbin:/bin
+. /lib/init/vars.sh
. /lib/lsb/init-functions
. /lib/init/mount-functions.sh
@@ -31,9 +32,13 @@
domount sysfs "" /sys sysfs -onodev,noexec,nosuid
fi
- # Mount /var/run and /var/lock as tmpfs.
- domount tmpfs "" /var/run varrun -omode=0755,nosuid
- domount tmpfs "" /var/lock varlock -omode=1777,nodev,noexec,nosuid
+ # Mount /var/run and /var/lock as tmpfs if enabled
+ if [ yes = "$TMPRUN" ] ; then
+ domount tmpfs "" /var/run varrun -omode=0755,nosuid
+ fi
+ if [ yes = "$TMPLOCK" ] ; then
+ domount tmpfs "" /var/lock varlock -omode=1777,nodev,noexec,nosuid
+ fi
#
# Mount usbfs/usbdevfs if /proc/bus/usb is present.
Modified: sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh 2006-09-16 10:42:00 UTC (rev 939)
+++ sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh 2006-09-19 14:32:31 UTC (rev 940)
@@ -122,9 +122,14 @@
# 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
+ if [ yes = "$TMPRUN" ] ; then
+ mkdir /dev/shm/var.run
+ mount -n --bind /var/run /dev/shm/var.run
+ fi
+ if [ yes = "$TMPLOCK" ] ; then
+ mkdir /dev/shm/var.lock
+ mount -n --bind /var/lock /dev/shm/var.lock
+ fi
}
#
@@ -132,16 +137,18 @@
#
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
+ if [ yes = "$TMPRUN" ] ; then
+ [ -d /var/run ] || mkdir /var/run
+ mount -n --move /dev/shm/var.run /var/run
+ rmdir /dev/shm/var.run
+ fi
+ if [ yes = "$TMPLOCK" ] ; then
+ [ -d /var/lock ] || mkdir /var/lock
+ mount -n --move /dev/shm/var.lock /var/lock
+ rmdir /dev/shm/var.lock
+ fi
- # Clean up after ourselves
- rmdir /dev/shm/var.run /dev/shm/var.lock
}
Modified: sysvinit/trunk/debian/initscripts/postinst
===================================================================
--- sysvinit/trunk/debian/initscripts/postinst 2006-09-16 10:42:00 UTC (rev 939)
+++ sysvinit/trunk/debian/initscripts/postinst 2006-09-19 14:32:31 UTC (rev 940)
@@ -154,7 +154,8 @@
done
#
-# Create /var/run and /var/lock
+# Create /var/run and /var/lock on the root partition to make sure
+# they are available if TMPRUN and TMPLOCK is enabled.
#
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-22"
then
@@ -170,42 +171,6 @@
fi
#
-# Mount /var/run and /var/lock
-#
-if [ "$PREV_VER" ] && dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-22"
-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 || :
Modified: sysvinit/trunk/debian/initscripts/rcS.5
===================================================================
--- sysvinit/trunk/debian/initscripts/rcS.5 2006-09-16 10:42:00 UTC (rev 939)
+++ sysvinit/trunk/debian/initscripts/rcS.5 2006-09-19 14:32:31 UTC (rev 940)
@@ -97,6 +97,12 @@
This will tell fsck always to repair the file systems
without asking for permission.
+.IP \fBTMPRUN\fP
+Mount /var/run/ as tmpfs. Set to 'yes' to enable, to 'no' to disable.
+
+.IP \fBTMPLOCK\fP
+Mount /var/lock/ as tmpfs. Set to 'yes' to enable, to 'no' to disable.
+
.SH NOTE
The \fBEDITMOTD\fP variable is no longer used.
Modified: sysvinit/trunk/debian/initscripts/share/default.rcS
===================================================================
--- sysvinit/trunk/debian/initscripts/share/default.rcS 2006-09-16 10:42:00 UTC (rev 939)
+++ sysvinit/trunk/debian/initscripts/share/default.rcS 2006-09-19 14:32:31 UTC (rev 940)
@@ -13,3 +13,5 @@
UTC=yes
VERBOSE=no
FSCKFIX=no
+TMPRUN=no
+TMPLOCK=no
More information about the Pkg-sysvinit-commits
mailing list