[H-GEN] [NetBSD 1.31] Need /etc/rc.local

Chris Baird cjb at brushtail.apana.org.au
Wed May 20 08:54:28 EDT 1998


In article <v03007801b188382bec78@[139.86.24.106]> you write:
>Hey guys,
>
>	I *accidentally* rm'ed the file from my box.
>
>	Now I cannot go into multi-user mode, I jumps into the shell when
>it can't find the file. Can some kind soul send me this file ? I know it's
>only a few lines and I am not really sure what they are. I don't wish to
>install the whole NetBSD kernel all over again ! *sigh*
>
>	3 hours to install NetBSD on my Macintosh LC III.
>
>	On that note, can anyone give me ideas how to set :
>
>1. My NetBSD box boots up in white background and black letters, anyway to
>inverse it ?
>
>2. Is there a utility to 'undelete' files ?
>
>3. Setting up a second IP address (alias) on my BSD box (i.e. 2 IP
>addresses for my NetBSD box), so that when I come into HUMBUG meetings, I
>could just use HUMBUG's private IP addresses, and another set for the hosts
>for my home machine. (I have 2 HUMBUG IP address, but I have 4 networking
>machines using TCP/IP at home).
>
>	Trying to tackle all those problems with the NetBSD FAQs but can't
>seem to go nowhere.....
>
>
>
>----------------------- HUMBUG General List --------------------------------
>echo "unsubscribe general" | mail majordomo at humbug.org.au # To Unsubscribe

#	$NetBSD: rc.local,v 1.14 1995/12/17 02:01:13 thorpej Exp $
#
# site-specific startup actions, daemons
#
#	From: @(#)rc.local	5.4 (Berkeley) 12/14/90
#

if [ -f /sbin/ldconfig ]; then
	echo 'creating runtime link editor directory cache.'
	ldconfig /usr/X11R6/lib
fi 

echo -n 'starting INN: '
if [ -f /usr/news/bin/rc.news ]; then
    su news -c /usr/news/bin/rc.news
fi

echo -n 'starting local daemons:'

# Kerberos runs ONLY on the Kerberos server machine
if [ X${kerberos_server} = X"YES" ]; then
	echo -n ' kerberos';	kerberos >> /var/log/kerberos.log &
fi

echo '.'

# path for pcvt utility programs: kcon, scon, loadfont, ispcvt and cursor
# FreeBSD 2.0 and earlier and all NetBSD releases
KCONP=/usr/local/bin
SCONP=/usr/local/bin
LDFNP=/usr/local/bin
ISPCP=/usr/sbin
CURSP=/usr/local/bin
FONTP=/usr/share/misc/pcvtfonts
XDMP=/usr/X11R6/bin
xdm_start=NO
set_keybd=NO
set_keydr=YES
set_keydr_rate=0
set_keydr_delay=0

construct_motd=YES

# set to YES to set up cursor start and end scanline
set_cursor=YES
set_cur_start=0
set_cur_end=16

#-----------------------------------------------------
# construct /etc/motd file
#-----------------------------------------------------

if [ X${construct_motd} = X"YES" ]
then
	if [ -f /netbsd ]
	then
		if [ ! -f /etc/motd ]; then
			install -c -o root -g wheel -m 664 /dev/null /etc/motd
		fi
		T=/tmp/_motd
		rm -f $T
		sysctl -n kern.version | sed 1q > $T
		echo "" >> $T
		sed '1,/^$/d' < /etc/motd >> $T
		cmp -s $T /etc/motd || cp $T /etc/motd
		rm -f $T
	else
		T=/tmp/_motd
		rm -f $T
		uname -a > $T
		echo "" >> $T
		sed '1,/^$/d' < /etc/motd >> $T
		cp $T /etc/motd
		chmod 644 /etc/motd
		rm -f $T

	fi
fi

#-----------------------------------------------------
# check for correct driver and driver version matching
#-----------------------------------------------------

if [ -x $ISPCP/ispcvt ]
then
  if $ISPCP/ispcvt -d /dev/ttyv0
  then

#--------------------------------------------------
# loading fonts into vga
#--------------------------------------------------
    echo 'console driver type: pcvt'
    if [ -x $LDFNP/loadfont -a -x $SCONP/scon ]
    then
      adaptor=`$SCONP/scon -d /dev/ttyv0 -a`
      if [ $adaptor = VGA ]
      then
        #echo 'loading 25 lines base font into character set 0'
        $LDFNP/loadfont -d /dev/ttyv0 -c0 -f $FONTP/vt220l.816
        #echo 'loading 25 lines extension font into character set 1'
        $LDFNP/loadfont -d /dev/ttyv0 -c1 -f $FONTP/vt220h.816
        #echo 'loading 28 lines base font into character set 2'
        $LDFNP/loadfont -d /dev/ttyv0 -c2 -f $FONTP/vt220l.814
        #echo 'loading 28 lines extension font into character set 3'
        $LDFNP/loadfont -d /dev/ttyv0 -c3 -f $FONTP/vt220h.814
        #echo 'loading 40 lines base font into character set 4'
        $LDFNP/loadfont -d /dev/ttyv0 -c4 -f $FONTP/vt220l.810
        #echo 'loading 40 lines extension font into character set 5'
        $LDFNP/loadfont -d /dev/ttyv0 -c5 -f $FONTP/vt220h.810
        #echo 'loading 50 lines base font into character set 6'
        $LDFNP/loadfont -d /dev/ttyv0 -c6 -f $FONTP/vt220l.808
        #echo 'loading 50 lines extension font into character set 7'
        $LDFNP/loadfont -d /dev/ttyv0 -c7 -f $FONTP/vt220h.808
      elif [ $adaptor = EGA ]
      then
        #echo 'loading 25 lines base font into character set 0'
        $LDFNP/loadfont -d /dev/ttyv0 -c0 -f $FONTP/vt220l.814
        #echo 'loading 25 lines extension font into character set 1'
        $LDFNP/loadfont -d /dev/ttyv0 -c1 -f $FONTP/vt220h.814
        #echo 'loading 35 lines base font into character set 2'
        $LDFNP/loadfont -d /dev/ttyv0 -c2 -f $FONTP/vt220l.810
        #echo 'loading 35 lines extension font into character set 3'
        $LDFNP/loadfont -d /dev/ttyv0 -c3 -f $FONTP/vt220h.810

#        echo 'loading 43 lines base font into character set 2'
#        $LDFNP/loadfont -d /dev/ttyv0 -c2 -f $FONTP/vt220l.808
#        echo 'loading 43 lines extension font into character set 3'
#        $LDFNP/loadfont -d /dev/ttyv0 -c3 -f $FONTP/vt220h.808

      fi
    fi

#--------------------------------------------------
# setting screen sizes and emulation
#--------------------------------------------------
    width=-
    if [ -x $SCONP/scon ]
    then
      if [ $adaptor = VGA ]
      then
        size=-s25
	width=-8
        echo 'switching to 28 lines and VT/HP-emulation'
      elif [ $adaptor = EGA ]
      then
        size=-s25
        echo 'switching to 25 lines and VT/HP-emulation'
      else
        size=
        echo 'switching to VT/HP-emulation'
      fi

# get monitor type (mono/color)

      monitor=`$SCONP/scon -d /dev/ttyv0 -m`

# for all screens do

      for device in /dev/ttyv[0-5]
      do

	$SCONP/scon -d$device $size # -H
	$SCONP/scon -d$device $width

# /dev/ttyv3 for syslog output

      $SCONP/scon -d/dev/ttyv3 -s 50
      $SCONP/scon -d/dev/ttyv3 -1

# setup cursor size

        if [ X${set_cursor} = X"YES" -a -x $CURSP/cursor ]
        then
          $CURSP/cursor -d$device -s$set_cur_start -e$set_cur_end
        fi

# if monochrome monitor, set color palette to use a higher intensity

        if [ $monitor = MONO ]
	then
          if [ $adaptor = VGA ]
          then
            $SCONP/scon -d$device -p8,60,60,60
          fi
        fi
      done

# switch to screen 0

      $SCONP/scon -d /dev/ttyv0

# set screensaver timeout to one minute

      $SCONP/scon -d /dev/ttyv0 -t360
    fi

#------------------------------------------------------
# if desired, setup keyboard for german keyboard layout
#------------------------------------------------------

    if [ X${set_keybd} = X"YES" -a -x $KCONP/kcon ]
    then
      echo 'switching to german keyboard layout'
      $KCONP/kcon -m de
    fi

#------------------------------------------------------
# if desired, setup rate and delay keyboard values
#------------------------------------------------------

    if [ X${set_keydr} = X"YES" -a -x $KCONP/kcon ]
    then
      echo setting keyboard typematic rate = $set_keydr_rate and delay = $set_keydr_delay
      $KCONP/kcon -r $set_keydr_rate -d $set_keydr_delay
    fi

#--------------------------------------------------
# if desired, start xdm on screen 8
#--------------------------------------------------

    if [ X${xdm_start} = X"YES" -a -x $XDMP/xdm ]
    then
      $SCONP/scon -d /dev/ttyv7
      $XDMP/xdm
      sleep 5
      $SCONP/scon -d /dev/ttyv0
    fi

#--------------------------------------------------
# cp /etc/ttys corresponding to console driver
#--------------------------------------------------

    if [ -f /etc/ttys.pcvt ]
    then
      echo 'linking /etc/ttys.pcvt -> /etc/ttys'
      rm -f /etc/ttys
      ln -s /etc/ttys.pcvt /etc/ttys
    fi

  else
    echo 'console driver type: not pcvt or pcvt utility/driver mismatch:'
    echo '--------------------------------------------------------------'
    $ISPCP/ispcvt -v -d /dev/ttyv0
    echo '--------------------------------------------------------------'
    if [ -f /etc/ttys.pccons ]
    then
      echo 'linking /etc/ttys.pccons -> /etc/ttys'
      rm -f /etc/ttys
      ln -s /etc/ttys.pccons /etc/ttys
    fi
  fi
else
  echo 'console driver type: not pcvt'
  if [ -f /etc/ttys.pccons ]
  then
    echo 'linking /etc/ttys.pccons -> /etc/ttys'
    rm -f /etc/ttys
    ln -s /etc/ttys.pccons /etc/ttys
  fi
fi

echo


----------------------- HUMBUG General List --------------------------------
echo "unsubscribe general" | mail majordomo at humbug.org.au # To Unsubscribe



More information about the General mailing list