Project

General

Profile

Download (11.9 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/bin/sh
2
3 3b6a207d Scott Ullrich
# $Id$
4
5 e5cd29a0 Scott Ullrich
# /etc/rc - master bootup script, invokes php setup
6
# part of pfSense by Scott Ullrich
7 8ad39798 Scott Ullrich
# Copyright (C) 2004-2010 Scott Ullrich, All rights reserved.
8 e5cd29a0 Scott Ullrich
# originally based on m0n0wall (http://neon1.net/m0n0wall)
9 5b237745 Scott Ullrich
# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
# All rights reserved.
11 d8a2ce2c Scott Ullrich
12
#/bin/stty status '^T'
13
#/bin/stty susp '^-' intr '^-' quit '^-'
14
15
#trap : 2
16
#trap : 3
17 5b237745 Scott Ullrich
18
HOME=/
19 ce823053 Scott Ullrich
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
20 5b237745 Scott Ullrich
export HOME PATH
21
22 1c44a77d Scott Ullrich
# Set our operating platform
23 e8d0903d Ermal
PLATFORM=`/bin/cat /etc/platform`
24 1c44a77d Scott Ullrich
25 842878b5 Scott Ullrich
# Set our current version
26 e8d0903d Ermal
version=`/bin/cat /etc/version`
27 842878b5 Scott Ullrich
28 e5323cca jim-p
# Setup dumpdev/ddb/savecore"
29
echo "Configuring crash dumps..."
30
if [ "$PLATFORM" = "pfSense" ]; then
31
	/etc/rc.dumpon
32
fi
33
34 c4995e62 Chris Buechler
# Mount memory file system if it exists
35 8022e257 Scott Ullrich
echo "Mounting filesystems..."
36 842878b5 Scott Ullrich
37 87db1017 Scott Ullrich
# Handle ZFS read-only case
38 6bc46900 Scott Ullrich
if [ "$PLATFORM" = "pfSense" ]; then
39
	if [ -f /usr/bin/grep ]; then
40
		WHEREISROOT=`/sbin/mount | /usr/bin/grep " / " | /usr/bin/grep "tank" | /usr/bin/cut -d' ' -f1`
41
		if [ "$WHEREISROOT" != "" ]; then
42
			/sbin/zfs set readonly=off $WHEREISROOT
43
		fi
44 8a8f51b7 Scott Ullrich
	fi
45 87db1017 Scott Ullrich
fi
46
47 842878b5 Scott Ullrich
if [ "$PLATFORM" = "cdrom" ]; then
48
	/etc/rc.cdrom
49
fi
50
51
if [ "$PLATFORM" = "embedded" ]; then
52 6c67a28d jim-p
	export PKG_TMPDIR=/root/
53 842878b5 Scott Ullrich
	/etc/rc.embedded
54
fi
55
56
if [ "$PLATFORM" = "nanobsd" ]; then
57 6c67a28d jim-p
	export PKG_TMPDIR=/root/
58 842878b5 Scott Ullrich
	/etc/rc.embedded
59
fi
60
61
if [ "$PLATFORM" = "pfSense" ]; then
62 e8d0903d Ermal
	/sbin/mdmfs -S -M -s 4m md /var/run
63 842878b5 Scott Ullrich
fi
64 c4995e62 Chris Buechler
65
# Mount /. If it fails run a fsck.
66
if [ ! "$PLATFORM" = "cdrom" ] ; then
67 ce8efd06 Scott Ullrich
	if [ "$PLATFORM" = "nanobsd" ]; then
68 842878b5 Scott Ullrich
		/sbin/mount -uw / || (/sbin/fsck -fy; /sbin/mount -uw /)
69 ce8efd06 Scott Ullrich
	else 
70
		/sbin/mount -a || (/sbin/fsck -fy; /sbin/mount -a)
71
	fi
72 842878b5 Scott Ullrich
	# If /conf is a directory, convert it to a symlink to /cf/conf
73 c4995e62 Chris Buechler
	if [ -d "/conf" ]; then
74
		# If item is not a symlink then rm and recreate
75
		CONFPOINTSTO=`readlink /conf` 
76
		if ! test "x$CONFPOINTSTO" = "x/cf/conf"; then 
77 e8d0903d Ermal
			/bin/rm -rf /conf
78
			/bin/ln -s /cf/conf /conf
79 c4995e62 Chris Buechler
		fi
80
	fi
81
fi
82
83 7734aea6 Andrew Thompson
if [ ! "$PLATFORM" = "jail" ]; then
84
	# Check to see if a compact flash mountpoint exists
85
	# If it fails to mount then run a fsck -fy
86
	if grep -q cf /etc/fstab; then
87
		/sbin/mount -w /cf 2>/dev/null
88
		/sbin/mount -uw /cf || \
89
			(/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf)
90
	fi
91 c4995e62 Chris Buechler
fi
92
93 ca3537ba jim-p
# sync pw database after mount.
94 01656166 jim-p
rm -f /etc/spwd.db.tmp
95
/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd
96 ca3537ba jim-p
97 e8d0903d Ermal
product=`/usr/bin/grep product_name /etc/inc/globals.inc | /usr/bin/cut -d'"' -f4`
98
hideplatform=`/usr/bin/grep hideplatform /etc/inc/globals.inc | /usr/bin/wc -l`
99
varrunpath=`/usr/bin/grep varrun_path /etc/inc/globals.inc | /usr/bin/cut -d'"' -f4`
100 3d7639eb Scott Ullrich
101 6fafc69f Scott Ullrich
if [ "$hideplatform" -gt "0" ]; then
102 3d7639eb Scott Ullrich
	platformbanner="" # hide the platform
103
else
104
	platformbanner=" on the '${PLATFORM}' platform"
105
fi
106 1c44a77d Scott Ullrich
107
echo
108
cat /etc/ascii-art/pfsense-logo-small.txt
109
echo
110
echo
111 ba2cbed4 Scott Ullrich
echo "Welcome to ${product} ${version} ${platformbanner} ..."
112 1c44a77d Scott Ullrich
echo
113
114 7734aea6 Andrew Thompson
if [ ! "$PLATFORM" = "jail" ]; then
115
	# Enable console output if its muted.
116
	/sbin/conscontrol mute off >/dev/null
117
fi
118 d5f60dba Scott Ullrich
119 5621d2d5 Scott Ullrich
if [ "$PLATFORM" = "cdrom" ] ; then
120
	# do nothing for cdrom platform
121
elif [ "$PLATFORM" = "embedded" ] ; then
122 f92e9ff3 Scott Ullrich
    # do nothing for embedded platform
123 803c0401 Scott Ullrich
elif [ "$PLATFORM" = "nanobsd" ] ; then
124 99b8b304 Scott Ullrich
	# Ensure that packages can be persistent across reboots
125 cd465e06 Scott Ullrich
	/bin/mkdir -p /root/var/db/pkg
126 e8d0903d Ermal
	/bin/rm -rf /var/db/pkg
127
	/bin/ln -s /root/var/db/pkg/ /var/db/pkg
128 7734aea6 Andrew Thompson
elif [ "$PLATFORM" = "jail" ]; then
129
	# do nothing for jail platform
130 c0819d14 Jeb Campbell
else
131 3b39d0ac jim-p
	SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1`
132
	/sbin/swapon -a 2>/dev/null >/dev/null
133 e5323cca jim-p
	/etc/rc.savecore
134 98546a74 Scott Ullrich
fi
135 5621d2d5 Scott Ullrich
136 12bf92ca Scott Ullrich
if [ "$PLATFORM" = "cdrom" ] ; then
137 df40aa86 Scott Ullrich
	echo -n "Mounting unionfs directories..."
138 e8d0903d Ermal
	/bin/mkdir /tmp/unionfs
139
	/bin/mkdir /tmp/unionfs/usr
140
	/bin/mkdir /tmp/unionfs/root
141
	/bin/mkdir /tmp/unionfs/sbin
142
	/bin/mkdir /tmp/unionfs/bin
143
	/bin/mkdir /tmp/unionfs/boot
144
	/bin/mkdir /tmp/unionfs/confdefault
145
	/sbin/mount_unionfs /tmp/unionfs/usr /usr/
146
	/sbin/mount_unionfs /tmp/unionfs/root /root/
147
	/sbin/mount_unionfs /tmp/unionfs/bin /bin/		
148
	/sbin/mount_unionfs /tmp/unionfs/sbin /sbin/	
149
	/sbin/mount_unionfs /tmp/unionfs/boot /boot/
150
	/sbin/mount_unionfs /tmp/unionfs/confdefault /conf.default/
151 df40aa86 Scott Ullrich
	echo "done."
152 12bf92ca Scott Ullrich
fi
153
154 2e269da2 Scott Ullrich
echo -n "Creating symlinks..."
155 895ecb35 Scott Ullrich
# Make sure symlink is correct on embedded
156
if [ "$PLATFORM" = "embedded" ] ; then
157 e8d0903d Ermal
	/bin/rm /conf
158
	/bin/ln -s /cf/conf/ /conf
159 895ecb35 Scott Ullrich
fi
160
161 803c0401 Scott Ullrich
# Make sure symlink is correct on nanobsd
162
if [ "$PLATFORM" = "nanobsd" ] ; then
163 e8d0903d Ermal
	/bin/rm /conf
164
	/bin/ln -s /cf/conf/ /conf
165 803c0401 Scott Ullrich
fi
166
167 6bab150e Scott Ullrich
# Repair symlinks if they are broken
168
if [ ! -L /etc/syslog.conf ]; then
169 e8d0903d Ermal
	/bin/rm -rf /etc/syslog.conf
170
	/bin/ln -s /var/etc/syslog.conf /etc/syslog.conf
171 6bab150e Scott Ullrich
fi
172
173 f1cc2287 Scott Ullrich
# Repair symlinks if they are broken
174
if [ ! -L /etc/hosts ]; then
175 e8d0903d Ermal
	/bin/rm -rf /etc/hosts
176
	/bin/ln -s /var/etc/hosts /etc/hosts
177 c8fcdb2f Scott Ullrich
fi
178 095d04db Scott Ullrich
179 f1cc2287 Scott Ullrich
if [ ! -L /etc/resolv.conf ]; then
180 e8d0903d Ermal
    /bin/rm -rf /etc/resolv.conf
181
    /bin/ln -s /var/etc/resolv.conf /etc/resolv.conf
182 f1cc2287 Scott Ullrich
fi
183 095d04db Scott Ullrich
184 230787e7 Scott Ullrich
# Setup compatibility link for packages that
185
# have trouble overriding the PREFIX configure
186
# argument since we build our packages in a
187
# seperated PREFIX area
188 eb03f14e Chris Buechler
# Only create if symlink does not exist. 
189
if [ ! -h /tmp/tmp ]; then
190 e8d0903d Ermal
    /bin/ln -hfs / /tmp/tmp
191 eb03f14e Chris Buechler
fi
192 230787e7 Scott Ullrich
193 4be3f6cf Seth Mos
# Make sure our /tmp is 777 + Sticky
194 3fb8caf2 Scott Ullrich
if [ ! "$PLATFORM" = "cdrom" ] ; then
195 e8d0903d Ermal
	/bin/rm -rf /tmp/*
196 3fb8caf2 Scott Ullrich
fi
197 e8d0903d Ermal
/bin/chmod 1777 /tmp
198 0652f3ae Seth Mos
199 dd64811a Scott Ullrich
if [ ! "$PLATFORM" = "cdrom" ] ; then
200
	# Malloc debugging check
201
	if [ -L /etc/malloc.conf ]; then
202
	    #ln -s aj /etc/malloc.conf
203 e8d0903d Ermal
		/bin/rm /etc/malloc.conf
204 dd64811a Scott Ullrich
	fi
205 cecdf31c Scott Ullrich
fi
206
207 6484bb83 Scott Ullrich
if [ ! -L /etc/dhclient.conf ]; then
208 e8d0903d Ermal
    /bin/rm -rf /etc/dhclient.conf
209 6484bb83 Scott Ullrich
fi
210 c8fcdb2f Scott Ullrich
211 bfe6d078 Scott Ullrich
if [ ! -L /etc/sasyncd.conf ]; then
212 e8d0903d Ermal
    /bin/mkdir -p /var/etc/
213
    /usr/bin/touch /var/etc/sasyncd.conf
214
    /bin/rm -rf /etc/sasyncd.conf
215
    /bin/ln -s /var/etc/sasyncd.conf /etc/sasyncd.conf
216
    /usr/sbin/chown root:wheel /var/etc/sasyncd.conf
217
    /bin/chmod 0600 /var/etc/sasyncd.conf
218 bfe6d078 Scott Ullrich
fi
219
220 544156a7 Scott Ullrich
if [ ! -d /var/tmp ]; then
221 e8d0903d Ermal
	/bin/mkdir -p /var/tmp
222 544156a7 Scott Ullrich
fi
223 4aa70cd8 Scott Ullrich
224 544156a7 Scott Ullrich
if [ ! -d /cf/conf/backup/ ]; then
225 e8d0903d Ermal
	/bin/mkdir -p /cf/conf/backup/ 
226 544156a7 Scott Ullrich
fi
227 d42c2e20 Scott Ullrich
228 9f85112d Scott Ullrich
# OpenVPN storage
229 359e3f6a Scott Ullrich
if [ ! -d /var/etc/openvpn ]; then
230 e8d0903d Ermal
	/bin/mkdir -p /var/etc/openvpn
231 359e3f6a Scott Ullrich
fi
232
if [ ! -d /var/etc/openvpn-csc ]; then
233 e8d0903d Ermal
	/bin/mkdir -p /var/etc/openvpn-csc
234 359e3f6a Scott Ullrich
fi
235 67df0c62 Scott Ullrich
236 5b237745 Scott Ullrich
set -T
237
trap "echo 'Reboot interrupted'; exit 1" 3
238
239 61f1e2ec Scott Ullrich
# Remove old nameserver resolution files
240 e8d0903d Ermal
/bin/rm -f /var/etc/nameserver*
241 61f1e2ec Scott Ullrich
242 f3677fc5 Scott Ullrich
# Create uploadbar tmp directory
243 e8d0903d Ermal
/bin/mkdir -p /tmp/uploadbar
244
/bin/chmod 0777 /tmp/uploadbar
245 f3677fc5 Scott Ullrich
246 5b237745 Scott Ullrich
# make some directories in /var
247 e8d0903d Ermal
/bin/mkdir -p /var/run /var/log /var/etc /var/db/entropy /var/at/jobs/ /var/empty 2>/dev/null
248
/bin/rm /var/log/* 2>/dev/null
249
/bin/rm -rf /var/run/*
250 5b237745 Scott Ullrich
251 2e269da2 Scott Ullrich
echo -n "."
252 74772f9f Scott Ullrich
DISABLESYSLOGCLOG=`cat /cf/conf/config.xml | grep disablesyslogclog | wc -l | awk '{ print $1 }'`
253 dbdbd597 Scott Ullrich
if [ "$DISABLESYSLOGCLOG" -gt "0" ]; then 
254 e8d0903d Ermal
	/usr/bin/touch /var/log/system.log
255
	/usr/bin/touch /var/log/filter.log
256
	/usr/bin/touch /var/log/dhcpd.log
257
	/usr/bin/touch /var/log/vpn.log
258 a6607b5f jim-p
	/usr/bin/touch /var/log/pptps.log
259
	/usr/bin/touch /var/log/poes.log
260
	/usr/bin/touch /var/log/l2tps.log
261 e8d0903d Ermal
	/usr/bin/touch /var/log/openvpn.log
262
	/usr/bin/touch /var/log/portalauth.log
263
	/usr/bin/touch /var/log/ipsec.log
264
	/usr/bin/touch /var/log/ppp.log
265
	/usr/bin/touch /var/log/relayd.log
266 689eaa4d jim-p
	/usr/bin/touch /var/log/wireless.log
267 e8d0903d Ermal
	/usr/bin/touch /var/log/lighttpd.log
268
	/usr/bin/touch /var/log/ntpd.log
269
	/usr/bin/touch /var/log/apinger.log
270 dbdbd597 Scott Ullrich
else 
271 8274afc7 Scott Ullrich
	ENABLEFIFOLOG=`cat /cf/conf/config.xml | grep usefifolog | wc -l | awk '{ print $1 }'`
272
	if [ "$ENABLEFIFOLOG" -gt "0" ]; then
273
		# generate fifolog files
274
		/usr/sbin/fifolog_create -s 511488 /var/log/system.log
275
		/usr/sbin/fifolog_create -s 511488 /var/log/filter.log
276
		/usr/sbin/fifolog_create -s 50688 /var/log/dhcpd.log
277
		/usr/sbin/fifolog_create -s 50688 /var/log/vpn.log
278 a6607b5f jim-p
		/usr/sbin/fifolog_create -s 50688 /var/log/pptps.log
279
		/usr/sbin/fifolog_create -s 50688 /var/log/poes.log
280
		/usr/sbin/fifolog_create -s 50688 /var/log/l2tps.log
281 8274afc7 Scott Ullrich
		/usr/sbin/fifolog_create -s 50688 /var/log/openvpn.log
282
		/usr/sbin/fifolog_create -s 50688 /var/log/portalauth.log
283
		/usr/sbin/fifolog_create -s 50688 /var/log/ipsec.log
284 295e19dd Scott Ullrich
		/usr/sbin/fifolog_create -s 50688 /var/log/ppp.log
285 8274afc7 Scott Ullrich
		/usr/sbin/fifolog_create -s 50688 /var/log/relayd.log
286 689eaa4d jim-p
		/usr/sbin/fifolog_create -s 50688 /var/log/wireless.log
287 8274afc7 Scott Ullrich
		/usr/sbin/fifolog_create -s 50688 /var/log/lighttpd.log
288
		/usr/sbin/fifolog_create -s 50688 /var/log/ntpd.log
289 b1f4d7d4 Chris Buechler
		/usr/sbin/fifolog_create -s 50688 /var/log/apinger.log
290 8274afc7 Scott Ullrich
	else 
291
		/usr/sbin/clog -i -s 512144 /var/log/system.log
292
		/usr/sbin/clog -i -s 512144 /var/log/filter.log
293
		/usr/sbin/clog -i -s 65535 /var/log/dhcpd.log
294
		/usr/sbin/clog -i -s 65535 /var/log/vpn.log
295 a6607b5f jim-p
		/usr/sbin/clog -i -s 50688 /var/log/pptps.log
296
		/usr/sbin/clog -i -s 50688 /var/log/poes.log
297
		/usr/sbin/clog -i -s 50688 /var/log/l2tps.log
298 8274afc7 Scott Ullrich
		/usr/sbin/clog -i -s 65535 /var/log/openvpn.log
299
		/usr/sbin/clog -i -s 65535 /var/log/portalauth.log
300
		/usr/sbin/clog -i -s 65535 /var/log/ipsec.log
301 295e19dd Scott Ullrich
		/usr/sbin/clog -i -s 65535 /var/log/ppp.log
302 8274afc7 Scott Ullrich
		/usr/sbin/clog -i -s 65535 /var/log/slbd.log
303
		/usr/sbin/clog -i -s 65535 /var/log/lighttpd.log
304
		/usr/sbin/clog -i -s 65535 /var/log/ntpd.log
305 b1f4d7d4 Chris Buechler
		/usr/sbin/clog -i -s 65535 /var/log/relayd.log	
306 b3e15d1b jim-p
		/usr/sbin/clog -i -s 65535 /var/log/wireless.log
307 b1f4d7d4 Chris Buechler
		/usr/sbin/clog -i -s 65535 /var/log/apinger.log	
308 8274afc7 Scott Ullrich
	fi
309 dbdbd597 Scott Ullrich
fi 
310 57ecd9b6 Scott Ullrich
# change permissions on newly created fifolog files.
311 e8d0903d Ermal
/bin/chmod 0600 /var/log/*.log
312 8d418ca9 Scott Ullrich
313 2e269da2 Scott Ullrich
echo -n "."
314 7734aea6 Andrew Thompson
if [ ! "$PLATFORM" = "jail" ]; then
315
	DEVFS=`/sbin/mount | /usr/bin/grep devfs | /usr/bin/wc -l | /usr/bin/cut -d" " -f8`
316
	if [ "$DEVFS" = "0" ]; then
317
		mount_devfs devfs /dev
318
	fi
319 f93c5384 Scott Ullrich
fi
320 5b237745 Scott Ullrich
321
# Create an initial utmp file
322 e8d0903d Ermal
cd /var/run && /bin/cp /dev/null utmp && /bin/chmod 644 utmp
323 5b237745 Scott Ullrich
324 2e269da2 Scott Ullrich
echo -n "."
325 6fe4f291 Scott Ullrich
/sbin/ldconfig -elf /usr/lib /usr/local/lib /lib
326 c268f10f Scott Ullrich
327 cdbc61b6 Scott Ullrich
# Make sure /etc/rc.conf doesn't exist.
328
if [ -f /etc/rc.conf ]; then
329 e8d0903d Ermal
    /bin/rm -rf /etc/rc.conf
330 cdbc61b6 Scott Ullrich
fi
331
332 7734aea6 Andrew Thompson
if [ ! "$PLATFORM" = "jail" ]; then
333
	# Launching kbdmux(4)
334
	if [ -f "/dev/kbdmux0" ]; then
335
		echo -n "."
336
		/usr/sbin/kbdcontrol -k /dev/kbdmux0 < /dev/console
337
		[ -c "/dev/atkbd0" ] && kbdcontrol -a atkbd0 < /dev/console
338
		[ -c "/dev/ukbd0" ] && kbdcontrol -a ukbd0 < /dev/console
339
	fi
340 4e7b2b27 Scott Ullrich
341 7734aea6 Andrew Thompson
	# Fire up unionfs if mount points exist.
342
	if [ -f /dist/uniondirs ]; then
343
		echo -n "."
344
		/etc/rc.d/unionfs start
345
	fi
346 b1ce7649 Scott Ullrich
fi
347 fa8f44ce Scott Ullrich
348 2e269da2 Scott Ullrich
echo "done."
349 deff30cd Scott Ullrich
350 64183253 Scott Ullrich
# Ensure gettytab is of a sane size
351
if [ `/bin/ls -la /etc/gettytab | /usr/bin/awk '{ print $5'}` -lt 512 ]; then
352
	echo ">>> Restoring /etc/gettytab due to unusal size"
353
	echo ">>> Restoring /etc/gettytab due to unusal size" | /usr/bin/logger
354 416e6432 Ermal
	/bin/cp /etc/gettytab.bak /etc/gettytab
355 64183253 Scott Ullrich
fi
356
357 ad0d7518 Scott Ullrich
# Recreate capabilities DB
358 416e6432 Ermal
/usr/bin/cap_mkdb /etc/login.conf
359 ad0d7518 Scott Ullrich
360 40e46009 Scott Ullrich
# Run the php.ini setup file and populate
361
# /usr/local/etc/php.ini and /usr/local/lib/php.ini
362 aa840cf9 Scott Ullrich
/etc/rc.php_ini_setup 2>/tmp/php_errors.txt
363 0cf5aa69 Scott Ullrich
364 206f684d Scott Ullrich
# Launch external configuration loader for supported platforms
365
if [ "$PLATFORM" = "embedded" ]; then
366 fb2e53da jim-p
	/usr/local/bin/php -q /etc/ecl.php
367 206f684d Scott Ullrich
fi
368
369
# Launch external configuration loader for supported platforms
370
if [ "$PLATFORM" = "nanobsd" ]; then
371 fb2e53da jim-p
	/usr/local/bin/php -q /etc/ecl.php
372 206f684d Scott Ullrich
fi
373
374
# Launch external configuration loader for supported platforms
375
if [ "$PLATFORM" = "pfSense" ]; then
376 690d24af Scott Ullrich
	/usr/local/bin/php -q /etc/ecl.php
377 206f684d Scott Ullrich
fi
378
379 490615d3 Scott Ullrich
if [ -f /etc/rc.custom_boot_early ]; then
380
	/bin/echo -n "Launching /etc/rc.custom_boot_early...";
381
	/etc/rc.custom_boot_early
382
	echo "Done"
383
fi
384
385 01599e5e Ermal
/usr/bin/nice -n20 /usr/local/sbin/check_reload_status
386 e8d0903d Ermal
387 b406ae66 Scott Ullrich
# let the PHP-based configuration subsystem set up the system now
388 8e2eb65e Scott Ullrich
echo -n "Launching the init system..."
389 e8d0903d Ermal
/bin/rm -f /cf/conf/backup/backup.cache
390
/bin/rm -f /root/lighttpd*
391
/usr/bin/touch $varrunpath/booting
392 b406ae66 Scott Ullrich
/etc/rc.bootup
393
394 c1da5030 Scott Ullrich
# If a shell was selected from recovery 
395
# console then just drop to the shell now.
396
if [ -f "/tmp/donotbootup" ]; then
397 b1d04497 Scott Ullrich
	echo "Dropping to recovery shell."
398 c1da5030 Scott Ullrich
	exit 0
399
fi
400
401 0c5e431d Scott Ullrich
echo -n "Starting CRON... "
402 ea83ac64 Scott Ullrich
cd /tmp && /usr/sbin/cron -s 2>/dev/null
403 0c5e431d Scott Ullrich
echo "done."
404 3e08b3c1 Scott Ullrich
405 5be5825e Scott Ullrich
# Start packages
406
/etc/rc.start_packages
407 3bd1bd72 Scott Ullrich
408 e8d0903d Ermal
/bin/rm -rf /usr/local/pkg/pf/CVS
409 bc086d51 Scott Ullrich
410 0092b3bd mgrooms
# Start ping handler every 240 seconds
411 e8d0903d Ermal
/usr/local/bin/minicron 240 /var/run/ping_hosts.pid /usr/local/bin/ping_hosts.sh
412 f2025e91 Scott Ullrich
413 0092b3bd mgrooms
# Start account expire handler every hour
414 41fb483a Ermal
/usr/local/bin/minicron 3600 /var/run/expire_accounts.pid /etc/rc.expireaccounts
415 0092b3bd mgrooms
416 f6ba4bd1 Scott Ullrich
# Start alias url updater every 24 hours
417 e8d0903d Ermal
/usr/local/bin/minicron 86400 /var/run/update_alias_url_data.pid /etc/rc.update_alias_url_data
418 f6ba4bd1 Scott Ullrich
419 c432da9c Scott Ullrich
/bin/chmod a+rw /tmp/.
420 b569598b Scott Ullrich
421 e393a4a8 Scott Ullrich
echo "Bootup complete"
422 416e6432 Ermal
/bin/rm $varrunpath/booting
423 1ba9533c Scott Ullrich
424 2d4be1c5 Scott Ullrich
/usr/local/bin/beep.sh start 2>&1 >/dev/null
425 e393a4a8 Scott Ullrich
426 4171fa68 Scott Ullrich
# Reset the cache.  read-only requires this.
427 7734aea6 Andrew Thompson
/bin/rm -f /tmp/config.cache
428 4171fa68 Scott Ullrich
429 d35cf0de Scott Ullrich
exit 0