[Pkg-sysvinit-devel] Bug#402828: initscripts: please add a RAMTMP variable to /etc/default/rcS
Luca Capello
luca at pca.it
Wed Nov 4 19:50:26 UTC 2009
tags 402828 + patch
thanks
Hi there!
This bug is quite old, can someone comment on it, please?
On Tue, 12 Dec 2006 22:55:18 +0100, Luca Capello wrote:
> actually, the user can set /var/run and /var/lock as tmpfs using the
> two variables RAMRUN=yes and RAMLOCK=yes in /etc/default/rcS. I'd
> like to have the same option for /tmp as tmpfs (e.g. RAMTMP=yes),
> instead of having to edit /etc/fstab.
Here the trivial patch, which I tested on my sid:
--8<---------------cut here---------------start------------->8---
diff --git a/default/rcS b/default/rcS
index 600c7fa..b6b4ad1 100644
--- a/default/rcS
+++ b/default/rcS
@@ -13,5 +13,6 @@ DELAYLOGIN=no
UTC=yes
VERBOSE=no
FSCKFIX=no
+RAMTMP=yes
RAMRUN=yes
RAMLOCK=yes
diff --git a/init.d/mountkernfs.sh b/init.d/mountkernfs.sh
index f3222b8..5792bbf 100755
--- a/init.d/mountkernfs.sh
+++ b/init.d/mountkernfs.sh
@@ -46,7 +46,13 @@ do_start () {
domount sysfs "" /sys sysfs -onodev,noexec,nosuid
fi
- # Mount /var/run and /var/lock as tmpfs if enabled
+ # Mount /tmp, /var/run and /var/lock as tmpfs if enabled
+ if [ yes = "$RAMTMP" ] ; then
+ TMP_OPT=
+ [ "${TMP_SIZE:=$TMPFS_SIZE}" ] && TMP_OPT=",size=$TMP_SIZE"
+ domount tmpfs "" /tmp tmp -orw,$TMP_OPT
+ touch /tmp/.ramfs
+ fi
if [ yes = "$RAMRUN" ] ; then
RUN_OPT=
[ "${RUN_SIZE:=$TMPFS_SIZE}" ] && RUN_OPT=",size=$RUN_SIZE"
--8<---------------cut here---------------end--------------->8---
Thx, bye,
Gismo / Luca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20091104/f98cf14b/attachment.pgp>
More information about the Pkg-sysvinit-devel
mailing list