Use echo instead of touch - saves on forking
This commit is contained in:
parent
639024a04a
commit
cffbaa6c4e
@ -24,7 +24,7 @@ start() {
|
|||||||
[ "${CLOCK}" = "UTC" ] && TBLURB="UTC"
|
[ "${CLOCK}" = "UTC" ] && TBLURB="UTC"
|
||||||
ebegin "Starting the System Clock Adjuster [${TBLURB}]"
|
ebegin "Starting the System Clock Adjuster [${TBLURB}]"
|
||||||
if [ "${CLOCK}" != "UTC" ] ; then
|
if [ "${CLOCK}" != "UTC" ] ; then
|
||||||
touch /etc/wall_cmos_clock
|
echo >/etc/wall_cmos_clock
|
||||||
start-stop-daemon --start --exec /sbin/adjkerntz -- -i
|
start-stop-daemon --start --exec /sbin/adjkerntz -- -i
|
||||||
else
|
else
|
||||||
rm -f /etc/wall_cmos_clock
|
rm -f /etc/wall_cmos_clock
|
||||||
|
@ -78,7 +78,7 @@ start() {
|
|||||||
cp "${font}" "${RC_LIBDIR}"/console
|
cp "${font}" "${RC_LIBDIR}"/console
|
||||||
echo "$(basename "${font}")" > "${RC_LIBDIR}"/console/font
|
echo "$(basename "${font}")" > "${RC_LIBDIR}"/console/font
|
||||||
if [ "${UNICODE}" = "yes" ] ; then
|
if [ "${UNICODE}" = "yes" ] ; then
|
||||||
touch "${RC_LIBDIR}"/console/unicode
|
echo > "${RC_LIBDIR}"/console/unicode
|
||||||
else
|
else
|
||||||
rm -f "${RC_LIBDIR}"/console/unicode
|
rm -f "${RC_LIBDIR}"/console/unicode
|
||||||
fi
|
fi
|
||||||
|
@ -26,15 +26,16 @@ start() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! touch -c /var/run 2> /dev/null ; then
|
if ! echo 2>/dev/null >/var/run/.test.$$ ; then
|
||||||
ewarn "Skipping /var and /tmp initialization (ro root?)"
|
ewarn "Skipping /var and /tmp initialization (ro root?)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
rm -f /var/run/.test.$$
|
||||||
|
|
||||||
if [ "${RC_UNAME}" = "Linux" ] ; then
|
if [ "${RC_UNAME}" = "Linux" ] ; then
|
||||||
# Setup login records
|
# Setup login records
|
||||||
> /var/run/utmp
|
echo > /var/run/utmp
|
||||||
touch /var/log/wtmp
|
[ -e /var/log/wtmp ] || echo > /var/log/wtmp
|
||||||
chgrp utmp /var/run/utmp /var/log/wtmp
|
chgrp utmp /var/run/utmp /var/log/wtmp
|
||||||
chmod 0664 /var/run/utmp /var/log/wtmp
|
chmod 0664 /var/run/utmp /var/log/wtmp
|
||||||
fi
|
fi
|
||||||
@ -72,7 +73,7 @@ start() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the .keep to stop portage from removing /var/lock
|
# Create the .keep to stop portage from removing /var/lock
|
||||||
> /var/lock/.keep
|
echo > /var/lock/.keep
|
||||||
eend 0
|
eend 0
|
||||||
|
|
||||||
# Clean up /tmp directory
|
# Clean up /tmp directory
|
||||||
@ -120,13 +121,12 @@ start() {
|
|||||||
|
|
||||||
# Create an 'after-boot' dmesg log
|
# Create an 'after-boot' dmesg log
|
||||||
if [ "${RC_SYS}" != "VPS" ] ; then
|
if [ "${RC_SYS}" != "VPS" ] ; then
|
||||||
touch /var/log/dmesg
|
|
||||||
chmod 640 /var/log/dmesg
|
|
||||||
dmesg > /var/log/dmesg
|
dmesg > /var/log/dmesg
|
||||||
|
chmod 640 /var/log/dmesg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for /etc/resolv.conf, and create if missing
|
# Check for /etc/resolv.conf, and create if missing
|
||||||
[ -f /etc/resolv.conf ] || touch /etc/resolv.conf 2>/dev/null
|
[ -e /etc/resolv.conf ] || echo >/etc/resolv.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
@ -7,14 +7,11 @@ and optionally repair them."
|
|||||||
|
|
||||||
do_mtab() {
|
do_mtab() {
|
||||||
# Don't create mtab if /etc is readonly
|
# Don't create mtab if /etc is readonly
|
||||||
if ! touch /etc/mtab 2> /dev/null ; then
|
if ! echo 2>/dev/null >/etc/mtab ; then
|
||||||
ewarn "Skipping /etc/mtab initialization" "(ro root?)"
|
ewarn "Skipping /etc/mtab initialization" "(ro root?)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clear the existing mtab
|
|
||||||
> /etc/mtab
|
|
||||||
|
|
||||||
# Add the entry for / to mtab
|
# Add the entry for / to mtab
|
||||||
mount -f /
|
mount -f /
|
||||||
|
|
||||||
@ -43,7 +40,7 @@ do_fsck() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if touch /.test.$$ 2> /dev/null ; then
|
if echo 2>/dev/null >/.test.$$ ; then
|
||||||
einfo "root filesystem is mounted read-write - skipping"
|
einfo "root filesystem is mounted read-write - skipping"
|
||||||
rm -f /.test.$$
|
rm -f /.test.$$
|
||||||
return 0
|
return 0
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
# mount $svcdir as something we can write to if it's not rw
|
# mount $svcdir as something we can write to if it's not rw
|
||||||
# On vservers, / is always rw at this point, so we need to clean out
|
# On vservers, / is always rw at this point, so we need to clean out
|
||||||
# the old service state data
|
# the old service state data
|
||||||
if touch "${RC_SVCDIR}/.test" 2>/dev/null ; then
|
if echo 2>/dev/null >"${RC_SVCDIR}/.test.$$" ; then
|
||||||
rm -rf "${RC_SVCDIR}/.test" \
|
rm -rf "${RC_SVCDIR}/.test.$$" \
|
||||||
$(ls -d1 "${RC_SVCDIR:-/lib/rcscripts/init.d}"/* 2>/dev/null | \
|
$(ls -d1 "${RC_SVCDIR:-/lib/rcscripts/init.d}"/* 2>/dev/null | \
|
||||||
grep -Ev "/(deptree|ksoftlevel)$")
|
grep -Ev "/(deptree|ksoftlevel)$")
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user