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