#!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/files/bootmisc,v 1.1 2002/04/23 10:28:03 azarah Exp $ depend() { need clock localmount hostname } start() { if [ "${BOOT}" = "yes" ] then # Put a nologin file in /etc to prevent people from logging in before # system startup is complete. if [ "${DELAYLOGIN}" = "yes" ] then echo "System bootup in progress - please wait" > /etc/nologin cp /etc/nologin /etc/nologin.boot &>/dev/null fi if [ -e /etc/sysctl.conf ] then ebegin "Configuring kernel parameters" sysctl -p /etc/sysctl.conf &>/dev/null eend 0 fi if [ -x /usr/sbin/env-update ] then ebegin "Updating environment" rc-envupdate.sh >/dev/null eend 0 fi # # Clean up any stale locks. # ebegin "Cleaning /var/lock, /var/run" ( cd /var/lock && find . -type f -exec rm -f -- {} \; 1>&2 ) # # Clean up /var/run and create /var/run/utmp so that we can login. # ( cd /var/run && \ find . ! -type d ! -name utmp ! -name innd.pid ! -name random-seed \ -exec rm -f -- {} \; 1>&2 ) : > /var/run/utmp #remove /var/run/utmpx rm -f /var/run/utmpx #create the .keep to stop portage from removing /var/lock >/var/lock/.keep eend 0 # # Clean up /tmp directory # ebegin "Cleaning /tmp directory" rm -f /tmp/.X*-lock &>/dev/null rm -f /tmp/esrv* &>/dev/null rm -f /tmp/kio* &>/dev/null rm -f /tmp/jpsock.* &>/dev/null rm -rf /tmp/.esd* &>/dev/null rm -rf /tmp/orbit-* &>/dev/null rm -rf /tmp/ssh-* &>/dev/null rm -rf /tmp/ksocket-* &>/dev/null rm -rf /tmp/.*-unix &>/dev/null eend 0 fi # # Check for /etc/resolv.conf, and create if missing # [ -f /etc/resolv.conf ] || touch /etc/resolv.conf &>/dev/null if [ -c /dev/ttyp0 ] then chmod 666 /dev/tty[p-za-e][0-9a-f] &>/dev/null chown root:tty /dev/tty[p-za-e][0-9a-f] &>/dev/null fi } # vim:ts=4