Package: ifupdown
Version: 0.6.4-4.9
Severity: important
Tags: patch
At the moment, the postinst script in ifupdown set up
/etc/network/run/ as a symlink to /dev/shm/network/. But the
/dev/shm/ file system is reserved for use by the shm* glibc functions,
and should not be used as a generic state storing area.
Recently, in version 2.86.ds1-23 of initscripts, the boot system in
debian was changed to provide /lib/init/rw/ as a writable tmpfs area
for scripts running early in the boot. ifupdown might run very early
in the boot, and would be better of using this area instead of
/dev/shm/. Here is an untested patch to move ifupdown over to use
this new tmpfs.
diff -ur ../ifupdown-0.6.8/debian/changelog ../ifupdown-0.6.9/debian/changelog
--- ../ifupdown-0.6.8/debian/changelog 2006-09-28 19:08:55.000000000 +0200
+++ ../ifupdown-0.6.9/debian/changelog 2006-09-28 21:20:36.000000000 +0200
@@ -1,3 +1,10 @@
+ifupdown (0.6.9) experimental; urgency=low
+
+ * Prefer /lib/init/rw/network over /dev/shm/ for storing the state file
+ if the former is mounted as a tmpfs.
+
+ -- Petter Reinholdtsen <[EMAIL PROTECTED]> Thu, 28 Sep 2006 21:19:32 +0200
+
ifupdown (0.6.8) unstable; urgency=low
* Add myself as co-maintainer with approval from Anthony Towns.
diff -ur ../ifupdown-0.6.8/debian/postinst ../ifupdown-0.6.9/debian/postinst
--- ../ifupdown-0.6.8/debian/postinst 2006-09-15 20:03:19.000000000 +0200
+++ ../ifupdown-0.6.9/debian/postinst 2006-09-28 21:18:55.000000000 +0200
@@ -48,26 +48,26 @@
mv /etc/network/run /etc/network/run.dpkg-old
fi
- # The best choice is to use /dev/shm/network
+ # The best choice is to use /lib/init/rw/network
#
# If we can't use that, we'll just make /etc/network/run a directory,
# unless we're upgrading, in which case we'll just keep ifstate where it
# is, by making /etc/network/run a symlink to /etc/network.
- WHAT_TO_USE=devshm
+ WHAT_TO_USE=initrw
- if [ ! -d /dev/shm -o ! -w /dev/shm -o ! -r /proc/mounts ]; then
+ if [ ! -d /lib/init/rw -o ! -w /lib/init/rw -o ! -r /proc/mounts ]; then
WHAT_TO_USE=owndir
- elif ! grep -qs
"^tmpfs[[:space:]]\+/dev/shm[[:space:]]\+tmpfs[[:space:]]\+\([^[:space:]]\+,\)\?rw"
/proc/mounts
+ elif ! grep -qs
"^tmpfs[[:space:]]\+/lib/init/rw[[:space:]]\+tmpfs[[:space:]]\+\([^[:space:]]\+,\)\?rw"
/proc/mounts
then
WHAT_TO_USE=owndir
elif grep -qs '[[:space:]]/dev[[:space:]]devfs[[:space:]]' /proc/mounts; then
WHAT_TO_USE=owndir
fi
- # Check for available space if we are using devshm
- if [ "$WHAT_TO_USE" = devshm ]; then
- SPACE=`df -k /dev/shm | tail -1 | awk '{if ($4 ~ /%/) { print $3 } else {
print $4 } }'`
+ # Check for available space if we are using initrw
+ if [ "$WHAT_TO_USE" = initrw ]; then
+ SPACE=`df -k /lib/init/rw | tail -1 | awk '{if ($4 ~ /%/) { print $3 }
else { print $4 } }'`
if [ "$SPACE" -le 0 ]; then
WHAT_TO_USE=owndir
fi
@@ -77,10 +77,10 @@
WHAT_TO_USE=etcnetwork
fi
- if [ "$WHAT_TO_USE" = devshm ]
+ if [ "$WHAT_TO_USE" = initrw ]
then
- [ -d /dev/shm/network ] || mkdir /dev/shm/network
- ln -s /dev/shm/network /etc/network/run
+ [ -d /lib/init/rw/network ] || mkdir /lib/init/rw/network
+ ln -s /lib/init/rw/network /etc/network/run
elif [ "$WHAT_TO_USE" = "owndir" ]; then
mkdir /etc/network/run
else
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]