Project

General

Profile

Download (2.05 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/bin/sh
2

    
3
# /etc/rc - master bootup script, invokes php setup
4
# part of pfSense by Scott Ullrich
5
# Copyright (C) 2004 Scott Ullrich, All rights reserved.
6
# originally based on m0n0wall (http://neon1.net/m0n0wall)
7
# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
# All rights reserved.
9

    
10
stty status '^T'
11

    
12
trap : 2
13
trap : 3
14

    
15
HOME=/
16
PATH=/sbin:/bin:/usr/sbin:/usr/bin
17
export HOME PATH
18

    
19
echo
20
echo "Starting pfSense ..."
21
echo
22

    
23
/sbin/mount -a || fsck -y && mount -a
24
SWAPDEVICE=`cat /etc/fstab | grep swap | cut -f1`
25
/sbin/dumpon -v $SWAPDEVICE
26
/sbin/swapon -a
27
/bin/mkdir -p /usr/savecore 2>/dev/null
28
/sbin/savecore /usr/savecore $SWAPDEVICE
29

    
30
rm -rf /var/run/*
31
rm -rf /tmp/*
32

    
33
set -T
34
trap "echo 'Reboot interrupted'; exit 1" 3
35

    
36
# make some directories in /var
37
mkdir /var/run /var/log /var/etc /var/db/ipf 2>/dev/null
38
chmod 0755 /var/db/ipf
39
rm -rf /var/log/*
40

    
41
# generate circular logfiles
42
clog -i -s 262144 /var/log/system.log
43
clog -i -s 262144 /var/log/filter.log
44
clog -i -s 32768 /var/log/dhcpd.log
45
clog -i -s 32768 /var/log/vpn.log
46
clog -i -s 32768 /var/log/portalauth.log
47
chmod 0600 /var/log/system.log /var/log/filter.log /var/log/dhcpd.log /var/log/vpn.log /var/log/portalauth.log
48

    
49
adjkerntz -i
50

    
51
sysctl net.inet.tcp.sack.enable=0
52

    
53
mount_devfs devfs /dev
54

    
55
echo Syncing master.passwd...
56
/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd
57

    
58
# Create an initial utmp file
59
cd /var/run && cp /dev/null utmp && chmod 644 utmp
60

    
61
# Build devices database
62
#dev_mkdb
63

    
64
# Run ldconfig
65
/sbin/ldconfig -elf /usr/lib /usr/local/lib
66

    
67
# let the PHP-based configuration subsystem set up the system now
68
/etc/rc.bootup
69

    
70
echo Starting INETD for FTP-PROXY...
71
/usr/sbin/inetd -wW -C 60
72

    
73
echo Starting Secure Shell Services...
74
/etc/sshd
75

    
76
echo Starting USB...
77
/usr/sbin/usbd 2>>/tmp/bootup_messages
78

    
79
/usr/sbin/cron 2>>/tmp/bootup_messages
80

    
81
echo Executing rc.d items...
82
for FILE in /usr/local/etc/rc.d/*.sh; do
83
    if [ -e $FILE ]; then
84
        echo "Starting ${FILE}..."
85
        sh $FILE >>/tmp/bootup_messages 2>&1
86
    fi
87
done
88

    
89
# one more pass to give package plugins a chance to adjust
90
/etc/rc.filter_configure
91

    
92
exit 0
93

    
(17-17/43)