Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / release / picobsd / floppy.tree / etc / rc1
1 #!/bin/sh
2 # $FreeBSD: src/release/picobsd/floppy.tree/etc/rc1,v 1.1.2.4 2002/07/01 21:32:40 luigi Exp $
3 # $DragonFly: src/release/picobsd/floppy.tree/etc/Attic/rc1,v 1.2 2003/06/17 04:27:20 dillon Exp $
4 ### rc1, next stage 'rc' for PicoBSD -- THIS IS NOT THE NORMAL /etc/rc 
5
6 . /etc/rc.conf.defaults         # Load default procedures
7 rc_conf_set_defaults            # Assign default values to variables.
8 find_system_id                  # Set $main_eth $main_if
9 set_main_interface              # Set ${hostname} and ${ifconfig_${main_if}}
10 set_all_interfaces              # Set ${ifconfig_${if}} for other interfaces.
11
12 # Now process local configurations if present. ${hostname} should be set now,
13 # so rc.conf[.local] can make use of a case statement to set per-host things.
14
15 [ -f /etc/rc.conf ] && . /etc/rc.conf
16 [ -f /etc/rc.conf.local ] && . /etc/rc.conf.local
17
18 ### Now use some variables to override files in /etc ###
19 ( IFS=''
20 [ -n "${host_conf}" ] && echo ${host_conf} > /etc/host.conf
21 [ -n "${resolv_conf}" ] && echo ${resolv_conf} > /etc/resolv.conf
22 [ -n "${rc_local}" ] && echo ${rc_local} > /etc/rc.local
23 unset IFS
24 )
25
26 rm -f /var/run/*
27 if [ "x$swapfile" != "xNO" -a -w "$swapfile" -a -b /dev/vn0b ]; then
28         echo "Adding $swapfile as additional swap."
29         vnconfig /dev/vn0b $swapfile && swapon /dev/vn0b
30 else
31         echo "No swap partition available!"
32 fi
33 # configure serial devices
34 [ -f /etc/rc.serial ] && . /etc/rc.serial
35
36 # start up the initial network configuration.
37 if [ -f /etc/rc.network ]; then
38         . /etc/rc.network
39         network_pass1
40 fi
41 mount -a -t nfs
42 chmod 666 /dev/tty[pqrsPQRS]*
43 # clean up left-over files
44 (cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
45
46 [ -n "$network_pass1_done" ] && network_pass2
47 [ -n "$network_pass2_done" ] && network_pass3
48
49 pwd_mkdb -p ./master.passwd
50 dev_mkdb
51
52 [ -f /etc/syslog.conf -a -f /stand/syslogd ] && \
53         { echo "Starting syslogd."; syslogd ${syslogd_flags} ; }
54
55 [ "${inetd_enable}" = "YES" -a -f /stand/inetd ] && \
56         { echo "Starting inetd."; inetd ${inetd_flags} ; }
57
58 [ "${sshd_enable}" = "YES" -a -f /stand/sshd ] && \
59         { echo "Starting sshd..." ; sshd -f /etc/sshd_config ; }
60
61 [ -f /etc/rc.local ] && . /etc/rc.local
62
63 echo ''
64 cat /etc/motd
65 exit 0