#!/sbin/runscript # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ description="Read files in advance during boot" : ${ureadahead_binary:=/sbin/ureadahead} : ${tracing_timeout:=60} depend() { if can_start_early ; then # when tracing, debugfs is used need sysfs before '*' else need localmount # this should start as early as possible # we can't do 'before *' as that breaks it before bootmisc consolefont keymaps rmnologin serial urandom fi } can_start_early() { # short test to see if we have the right partitions mounted [ -e ${ureadahead_binary} ] && [ -e /var/lib/ureadahead ] } start() { local myopts="--timeout=${tracing_timeout}" if get_bootparam "force-tracing" ; then ewarn "Force boot tracing as requested in kernel cmdline" myopts="$myopts --force-trace" fi # ureadahead doesn't act like others daemons: # it must run in background only with SSD or when it traces the system. # On HDD il will run in foreground. # When tracing, it must be stopped a the end of the boot, # either by passing --timeout or by sending INT or TERM signal. # So it is not OK to launch it with start-stop-deamon since it # termination will be interpreted as a crash. ebegin "Starting ${SVCNAME}" ${ureadahead_binary} --quiet --daemon ${myopts} eend $? }