summaryrefslogtreecommitdiff
path: root/template/etc/rc
blob: d38a5f78826711ea65965174562f02d151aee22e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# minimalistic startup script

if [ x"$1" = x"shutdown" ]; then
	mount -o ro /
	exit 0
fi

# Set shell to ignore SIGINT (2), but not children;
# shell catches SIGQUIT (3) and returns to single user after fsck.
trap : 2
trap : 3	# shouldn't be needed

# some reasonable defaults, don't assume a .profile will set it
HOME=/; export HOME
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH

echo mfs: mounting /tmp...
mount_mfs -s 16384 swap /tmp

echo mfs: mounting /dev...
cp /dev/MAKEDEV /tmp/.
mount_mfs -s 1024 -i 1024 swap /dev

echo mfs: populating /dev...
mv /tmp/MAKEDEV /dev/.
( cd /dev && /dev/MAKEDEV std wd0 random pf bpf ttyC0 tty00 ptm pty )

echo mfs: populating /tmp...
mkdir /tmp/var
mkdir /tmp/var/tmp
mkdir /tmp/var/run
mkdir /tmp/var/log
mkdir /tmp/var/db
mkdir /tmp/var/empty
chmod -R 755 /tmp/var
touch /tmp/var/run/utmp
touch /tmp/var/log/authlog
touch /tmp/var/log/messages
touch /tmp/var/log/lastlog
touch /tmp/var/log/secure
touch /tmp/var/log/daemon 
touch /tmp/var/log/wtmp    
mkdir /tmp/var/cron
touch /tmp/var/cron/log
chown root:wheel /tmp/var/cron/log
chmod 0600 /tmp/var/cron/log
mkdir /tmp/var/cron/atjobs
cp -R /etc/tabs /tmp/var/cron/tabs
mkdir /tmp/var/tmp/vi.recover
mkdir /tmp/var/etc

echo store boot dmesg...
dmesg > /var/run/dmesg.boot

echo ldconfig: building library cache...
shlib_dirs="/usr/lib"
ldconfig $shlib_dirs

echo databases: dev...
dev_mkdb

echo kern.securelevel: 1
sysctl kern.securelevel=1

hostname=HOSTNAME.lan
echo hostname: setting hostname to $hostname...
hostname $hostname

define(filename,config/HOSTNAME/rc.net)
include(filename)

echo inet: configuring IP on system interfaces...
ifconfig lo0 127.0.0.1 netmask 255.0.0.0

echo inet: enable forwarding...
sysctl net.inet.ip.forwarding=1

echo pf: enabling firewall...
pfctl -e -f /etc/pf.conf

echo ntpd: starting network time daemon...
/usr/sbin/ntpd -s

echo syslogd: starting log daemon...
syslogd -p /dev/log

echo cron: starting daemon...
/usr/sbin/cron

echo ssh: starting daemon...
/usr/sbin/sshd

define(filename2,config/HOSTNAME/rc.services)
include(filename2)