summaryrefslogtreecommitdiffstats
path: root/example.files/rc
blob: 232afc3530f4c8596e587db945685c360e00d8d9 (plain) (blame)
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
# rc file for The Linux BOGUS Release, version 1.0.1

                                echo "Running /etc/rc. . ."

PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH

# Update (bdflush) performs flushes dirty buffers back to disk and
# performs a sync every 30 seconds.
                                echo "Starting update"
update &

if [ -f /fastboot ]
then
                                echo "Skipping file system check"
else
                                echo "Performing file system check"
    fsck -AV -a
    # If there was a failure, drop into single-user mode.
    # NOTE: This is not secure.  If security is needed, make sure than
    #       /etc/securesingle exists and "reboot single".  simipleinit
    #       will then prompt for root's password.
    if [ $? -gt 1 ]
    then
        echo "Warning: fsck FAILED"
        echo "         Starting single user shell"
        echo "         Fix filesystem and REBOOT"
        sh -si < /dev/console > /dev/console 2>&1
    fi
fi

                                echo "Mounting file systems"
# Remount the root filesystem in read-write mode
mount -n -o rw,remount /

# Remove the fastboot check file
rm -f /fastboot

# Remove /etc/mtab* so mount creates the /etc/mtab file
rm -f /etc/mtab*

# Mount all partitions specified in /etc/fstab
mount -avt nonfs,nomsdos,nohpfs

# Mount swap partition specified in /etc/fstab
swapon -a

                                echo -n "Initialization: "
# Update ps database
if [ -f /usr/sbin/psupdate -a -f /usr/src/linux/vmlinux ]; then
                                echo -n "psdatabase "
	/usr/sbin/psupdate /usr/src/linux/vmlinux
fi

# tmp and usr may be mounted, so we do these rm's after mount
                                echo -n "locks "
rm -f /var/lock/LCK*
                                echo -n "pids "
rm -f /var/run/*
                                echo -n "/tmp "
rm -rf /tmp; mkdir /tmp; chmod 1777 /tmp

# Remove /var/adm/utmp and touch it
                                echo -n "utmp "
if [ ! -e /var ]; then mkdir /var; chmod 755 /var; fi
if [ ! -e /var/adm ]; then mkdir /var/adm; chmod 755 /var/adm; fi
rm -f /var/adm/utmp
touch /var/adm/utmp
chmod 644 /var/adm/utmp

                                echo ""
                                echo "Running rc.local. . ."
sh /etc/rc.local

# Allow logins
                                echo "Allowing logins"
rm -f /etc/nologin

date
exit 0