1 | #!/bin/ash
|
---|
2 |
|
---|
3 | # System Startup Script
|
---|
4 | #
|
---|
5 | . /etc/rc.d/init.d/functions
|
---|
6 |
|
---|
7 | /bin/mount -t proc none /proc
|
---|
8 | /bin/mount -t sysfs none /sys
|
---|
9 | /bin/mount -t tmpfs /tmp /tmp
|
---|
10 | /bin/mkdir /dev/pts
|
---|
11 | /bin/mkdir /dev/shm
|
---|
12 |
|
---|
13 | /bin/echo "/sbin/mdev" > /proc/sys/kernel/hotplug
|
---|
14 |
|
---|
15 | echo -n "Starting mdev: "
|
---|
16 | /sbin/mdev -s
|
---|
17 | check_status
|
---|
18 |
|
---|
19 | echo -n "Mounting devpts: "
|
---|
20 | mount /dev/pts
|
---|
21 | check_status
|
---|
22 |
|
---|
23 | if [ -x /sbin/hwclock ] && [ -e /dev/rtc* ]; then
|
---|
24 | echo -n "Setting system clock: "
|
---|
25 | hwclock --hctosys --utc
|
---|
26 | check_status
|
---|
27 | fi
|
---|
28 |
|
---|
29 | if [ -x /sbin/fsck ]; then
|
---|
30 | echo "Starting fsck for local filesystems."
|
---|
31 | fsck -A -C -R -T -t nonfs,nosmbfs
|
---|
32 | if [ "$?" -gt 2 ]; then
|
---|
33 | echo "WARNING: Errors found while checking filesystems."
|
---|
34 | echo "You can login as root now, the system will reboot after logout."
|
---|
35 | sulogin
|
---|
36 | reboot
|
---|
37 | elif [ "$?" = "2" ]; then
|
---|
38 | echo "NOTICE: System needs to be rebooted now."
|
---|
39 | sleep 1
|
---|
40 | reboot
|
---|
41 | else
|
---|
42 | echo -n "Checking local filesystems: "
|
---|
43 | check_status
|
---|
44 | fi
|
---|
45 | fi
|
---|
46 |
|
---|
47 |
|
---|
48 | if [ -x /sbin/swapon ]; then
|
---|
49 | echo -n "Enabling swap space: "
|
---|
50 | swapon -a
|
---|
51 | check_status
|
---|
52 | fi
|
---|
53 |
|
---|
54 | echo -n "Remounting root rw: "
|
---|
55 | mount -o remount,rw /
|
---|
56 | check_status
|
---|
57 |
|
---|
58 | echo -n "Linking /var/tmp and /tmp: "
|
---|
59 | ln -s ../tmp /var/tmp
|
---|
60 | check_status
|
---|
61 |
|
---|
62 | echo -n "Setting hostname: "
|
---|
63 | hostname -F /etc/HOSTNAME
|
---|
64 | check_status
|
---|
65 |
|
---|
66 | echo -n "Cleaning up system: "
|
---|
67 | > /var/run/utmp
|
---|
68 | touch /var/log/wtmp
|
---|
69 | touch /var/log/messages
|
---|
70 | chmod 0664 /var/run/utmp
|
---|
71 | chmod 0664 /var/log/wtmp
|
---|
72 | chmod 0660 /var/log/messages
|
---|
73 | rm -rf /tmp/*
|
---|
74 | rm -f /var/run/*.pid
|
---|
75 | check_status
|
---|
76 |
|
---|
77 | echo -n "Setting up interface lo: "
|
---|
78 | ifconfig lo up 127.0.0.1
|
---|
79 | check_status
|
---|
80 |
|
---|
81 | echo "Running start scripts."
|
---|
82 |
|
---|
83 | for i in /etc/rc.d/start/*
|
---|
84 | do
|
---|
85 | if [ -x $i ]; then
|
---|
86 | $i start
|
---|
87 | fi
|
---|
88 | done
|
---|
89 |
|
---|
90 | exit 0
|
---|