rc revision 7294
1#!/bin/sh 2# $Id: rc,v 1.53 1995/03/24 00:01:20 jkh Exp $ 3# From: @(#)rc 5.27 (Berkeley) 6/5/91 4 5# System startup script run by init on autoboot 6# or after single-user. 7# Output and error are redirected to console by init, 8# and the console is the controlling terminal. 9 10stty status '^T' 11 12# Set shell to ignore SIGINT (2), but not children; 13# shell catches SIGQUIT (3) and returns to single user after fsck. 14trap : 2 15trap : 3 # shouldn't be needed 16 17HOME=/; export HOME 18PATH=/sbin:/bin:/usr/sbin:/usr/bin 19export PATH 20 21swapon -a 22 23if [ $1x = autobootx ] 24then 25 echo Automatic reboot in progress... 26 fsck -p 27 case $? in 28 0) 29 ;; 30 2) 31 exit 1 32 ;; 33 4) 34 reboot 35 echo "reboot failed... help!" 36 exit 1 37 ;; 38 8) 39 echo "Automatic file system check failed... help!" 40 exit 1 41 ;; 42 12) 43 echo "Reboot interrupted" 44 exit 1 45 ;; 46 130) 47 # interrupt before catcher installed 48 exit 1 49 ;; 50 *) 51 echo "Unknown error in reboot" 52 exit 1 53 ;; 54 esac 55else 56 echo Skipping disk checks ... 57fi 58 59trap "echo 'Reboot interrupted'; exit 1" 3 60 61# root must be read/write both for NFS diskless and for VFS LKMs before 62# proceeding any further. 63mount -u -o rw / 64 65umount -a >/dev/null 2>&1 66mount -a -t nonfs 67 68# If the machine runs wall CMOS clock (compatible with MSDOS), 69# activate following line by creating empty file /etc/wall_cmos_clock 70# If this file not exist, following line does nothing (assumed 71# the machine runs UTC CMOS clock). See adjkerntz(8) for details. 72adjkerntz -i 73 74# If there is a global system configuration file, suck it in. 75if [ -f /etc/sysconfig ]; then 76 . /etc/sysconfig 77fi 78 79# configure serial devices 80if [ -f /etc/rc.serial ]; then 81 . /etc/rc.serial 82fi 83 84# start up the network 85if [ -f /etc/netstart ]; then 86 . /etc/netstart 87fi 88 89# Do system maintainance functions. 90if [ -f /etc/rc.maint ]; then 91 . /etc/rc.maint 92fi 93 94# Now start up miscellaneous daemons that don't belong anywhere else 95# 96echo -n standard daemons: 97echo -n ' cron'; cron 98if [ "X${xtend}" != X"NO" -a -x /usr/libexec/xtend ]; then 99 echo -n ' xtend'; /usr/libexec/xtend 100fi 101echo -n ' printer'; lpd 102echo '.' 103 104mount -a -t nfs >/dev/null 2>&1 & # XXX shouldn't need background 105 106# Make shared lib searching a little faster. Leave /usr/lib first if you 107# add your own entries or you may come to grief. 108if [ -x /sbin/ldconfig ]; then 109 _LDC=/usr/lib 110 if [ -d /usr/X11R6/lib ]; then _LDC="${_LDC} /usr/X11R6/lib" ; fi 111 if [ -d /usr/X386/lib ]; then _LDC="${_LDC} /usr/X386/lib" ; fi 112 if [ -d /usr/local/lib ]; then _LDC="${_LDC} /usr/local/lib" ; fi 113 if [ -d /usr/gnu/lib ]; then _LDC="${_LDC} /usr/gnu/lib" ; fi 114 echo 'setting ldconfig path:' ${_LDC} 115 ldconfig ${_LDC} 116fi 117 118######################### Start Of Syscons Section ####################### 119 120kbdadjust=NO 121[ "X${keymap}" != X"NO" -o "X${keyrate}" != X"NO" ] && kbdadjust=YES 122vidadjust=NO 123[ "X${scrnmap}" != X"NO" -o "X${font8x16}" != X"NO" -o \ 124 "X${font8x14}" != X"NO" -o "X${font8x8}" != X"NO" -o \ 125 "X${blanktime}" != X"NO" ] && vidadjust=YES 126 127[ "X${kbdadjust}" != X"NO" -o "X${vidadjust}" != X"NO" -o \ 128 "X${saver}" != X"NO" ] && echo "starting syscons:" 129 130[ "X${kbdadjust}" != X"NO" ] && echo "kbdcontrol: " 131 132# keymap 133if [ "X${keymap}" != X"NO" ]; then 134 echo -n "keymap " 135 kbdcontrol -l ${keymap} 136fi 137 138# keyrate 139if [ "X${keyrate}" != X"NO" ]; then 140 echo -n "keyrate " 141 kbdcontrol -r ${keyrate} 142fi 143 144[ "X${kbdadjust}" != X"NO" ] && echo 145[ "X${vidadjust}" != X"NO" ] && echo "vidcontrol: " 146 147# screen mapping 148if [ "X${scrnmap}" != X"NO" ]; then 149 echo -n "screen_map " 150 vidcontrol -l ${scrnmap} 151fi 152 153# font 8x16 154if [ "X${font8x16}" != X"NO" ]; then 155 echo -n "font8x16 " 156 vidcontrol -f 8x16 ${font8x16} 157fi 158 159# font 8x14 160if [ "X${font8x14}" != X"NO" ]; then 161 echo -n "font8x14 " 162 vidcontrol -f 8x14 ${font8x14} 163fi 164 165# font 8x8 166if [ "X${font8x8}" != X"NO" ]; then 167 echo -n "font8x8 " 168 vidcontrol -f 8x8 ${font8x8} 169fi 170 171# blank time 172if [ "X${blanktime}" != X"NO" ]; then 173 echo -n "blank_time " 174 vidcontrol -t ${blanktime} 175fi 176 177[ "X${vidadjust}" != X"NO" ] && echo 178 179# screen saver 180if [ "X${saver}" != X"NO" ] ; then 181 echo -n "screensaver: " 182 modstat | grep _saver || modload -u -o /tmp/saver_mod -e \ 183 saver_init -q /lkm/${saver}_saver_mod.o 184fi 185 186######################### End Of Syscons Section ####################### 187 188# Do traditional (but rather obsolete) rc.local file if it exists. 189if [ -f /etc/rc.local ]; then 190 sh /etc/rc.local 191fi 192 193date 194exit 0 195