moto 寫:阿信跟 yungyuc 講的是對的,請多利用 rcS 取代原來 rc.local
用各位先進提供的資訊,把上述指令寫成一個名為 mounttmpdir 的 init script:
#! /bin/sh
#
# mounttmpdir Mount /tmp after mounvirtfs exec-ed
#
# Version: @(#)mounttmpdir 0.01 24-Dec-2004 antony shen
#
# Script needs to be robust and continue when parts fail,
# so we're not setting the "-e" flag.
#set -e
PATH=/lib/init:/bin:/sbin
if [ -d /dev/shm ]
then
if [ ! -d /dev/shm/tmp ]
then
echo -n "Mounting /tmp under /dev/shm..."
mkdir /dev/shm/tmp
chmod 1777 /dev/shm/tmp
mount --bind /dev/shm/tmp /tmp
echo "OK.
fi
else
echo "Failed to find /dev/shm, unable to link /tmp under it!"
fi
接者,可以用 update-rc.d 指令:
update-rc.d mounttmpdir start 37 S .
將這個 init.d script 加到 rcS 裡面。就可以運作了。大家可以試試看。