1 |
diff -ruN e-smith-base-5.4.0.old/root/etc/rc.d/rc.e-smith e-smith-base-5.4.0/root/etc/rc.d/rc.e-smith |
2 |
--- e-smith-base-5.4.0.old/root/etc/rc.d/rc.e-smith 2008-03-26 09:48:59.000000000 -0700 |
3 |
+++ e-smith-base-5.4.0/root/etc/rc.d/rc.e-smith 1969-12-31 16:00:00.000000000 -0800 |
4 |
@@ -1,190 +0,0 @@ |
5 |
-#!/bin/bash |
6 |
-# |
7 |
-# Customisation of the RedHat rc script, which allows services to return |
8 |
-# a value of 99, indicating "disabled" |
9 |
- |
10 |
-# Check whether file $1 is a backup or rpm-generated file and should be ignored |
11 |
-is_ignored_file() { |
12 |
- case "$1" in |
13 |
- *~ | *.bak | *.orig | *.rpmnew | *.rpmorig | *.rpmsave) |
14 |
- return 0 |
15 |
- ;; |
16 |
- esac |
17 |
- return 1 |
18 |
-} |
19 |
- |
20 |
-# check a file to be a correct runlevel script |
21 |
-check_runlevel () |
22 |
-{ |
23 |
- # Check if the file exists at all. |
24 |
- [ -x "$1" ] || return 1 |
25 |
- is_ignored_file "$1" && return 1 |
26 |
- return 0 |
27 |
-} |
28 |
- |
29 |
-# Now find out what the current and what the previous runlevel are. |
30 |
-argv1="$1" |
31 |
-set `/sbin/runlevel` |
32 |
-runlevel=$2 |
33 |
-previous=$1 |
34 |
-export runlevel previous |
35 |
- |
36 |
-# Source function library. |
37 |
-. /etc/init.d/functions |
38 |
- |
39 |
-# Now redefine some of the functions, and add one or two of our own. |
40 |
-# |
41 |
- |
42 |
-echo_success() { |
43 |
- [ "$BOOTUP" = "color" ] && $MOVE_TO_COL |
44 |
- echo -n "[ " |
45 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS |
46 |
- echo -n $"OK" |
47 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
48 |
- echo -n " ]" |
49 |
- echo -ne "\r" |
50 |
- return 0 |
51 |
-} |
52 |
- |
53 |
-echo_failure() { |
54 |
- [ "$BOOTUP" = "color" ] && $MOVE_TO_COL |
55 |
- echo -n "[" |
56 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE |
57 |
- echo -n $"FAILED" |
58 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
59 |
- echo -n "]" |
60 |
- echo -ne "\r" |
61 |
- return 1 |
62 |
-} |
63 |
- |
64 |
-echo_disabled() { |
65 |
- [ "$BOOTUP" = "color" ] && $MOVE_TO_COL |
66 |
- echo -n "[ " |
67 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING |
68 |
- echo -n "OFF" |
69 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
70 |
- echo -n " ]" |
71 |
- echo -ne "\r" |
72 |
- return 1 |
73 |
-} |
74 |
- |
75 |
-echo_warning() { |
76 |
- [ "$BOOTUP" = "color" ] && $MOVE_TO_COL |
77 |
- echo -n "[" |
78 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING |
79 |
- echo -n $"WARNING" |
80 |
- [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
81 |
- echo -n "]" |
82 |
- echo -ne "\r" |
83 |
- return 1 |
84 |
-} |
85 |
- |
86 |
-# Log that something succeeded |
87 |
-success() { |
88 |
- [ "$BOOTUP" != "verbose" -a -z "$LSB" ] && echo_success |
89 |
- return 0 |
90 |
-} |
91 |
- |
92 |
-# Log that something failed |
93 |
-failure() { |
94 |
- local rc=$? |
95 |
- [ "$BOOTUP" != "verbose" -a -z "$LSB" ] && echo_failure |
96 |
- return $rc |
97 |
-} |
98 |
- |
99 |
-# Log a warning |
100 |
-warning() { |
101 |
- local rc=$? |
102 |
- [ "$BOOTUP" != "verbose" -a -z "$LSB" ] && echo_warning |
103 |
- return $rc |
104 |
-} |
105 |
- |
106 |
-# Log that something passed, but is disabled in this configuration |
107 |
-disabled() { |
108 |
- local rc=$? |
109 |
- [ "$BOOTUP" != "verbose" ] && echo_disabled |
110 |
- return $rc |
111 |
-} |
112 |
- |
113 |
-# Run some action. Log its output. |
114 |
-action() { |
115 |
- local STRING=$1 |
116 |
- echo -n "$STRING " |
117 |
- shift |
118 |
- "$@" |
119 |
- local ret=$? |
120 |
- case $ret in |
121 |
- 0) success $"$STRING" ;; |
122 |
- 99) disabled $"$STRING" |
123 |
- ret=0 ;; |
124 |
- *) failure $"$STRING" ;; |
125 |
- esac |
126 |
- echo |
127 |
- return $ret |
128 |
-} |
129 |
- |
130 |
-# See if we want to be in user confirmation mode |
131 |
-if [ "$previous" = "N" ]; then |
132 |
- if [ -f /var/run/confirm ]; then |
133 |
- echo $"Entering interactive startup" |
134 |
- else |
135 |
- echo $"Entering non-interactive startup" |
136 |
- fi |
137 |
-fi |
138 |
- |
139 |
-# Get first argument. Set new runlevel to this argument. |
140 |
-[ -n "$argv1" ] && runlevel="$argv1" |
141 |
- |
142 |
-# Is there an rc directory for this new runlevel? |
143 |
-[ -d /etc/rc$runlevel.d ] || exit 0 |
144 |
- |
145 |
-# First, run the KILL scripts. |
146 |
-for i in /etc/rc$runlevel.d/K* ; do |
147 |
- check_runlevel "$i" || continue |
148 |
- |
149 |
- # Check if the subsystem is already up. |
150 |
- subsys=${i#/etc/rc$runlevel.d/K??} |
151 |
- [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \ |
152 |
- || continue |
153 |
- |
154 |
- # Bring the subsystem down. |
155 |
- if LC_ALL=C egrep -q "^..*init.d/functions" $i ; then |
156 |
- $i stop |
157 |
- else |
158 |
- action $"Stopping $subsys: " $i stop |
159 |
- fi |
160 |
-done |
161 |
- |
162 |
-# Now run the START scripts. |
163 |
-for i in /etc/rc$runlevel.d/S* ; do |
164 |
- check_runlevel "$i" || continue |
165 |
- |
166 |
- # Check if the subsystem is already up. |
167 |
- subsys=${i#/etc/rc$runlevel.d/S??} |
168 |
- [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \ |
169 |
- && continue |
170 |
- |
171 |
- # If we're in confirmation mode, get user confirmation |
172 |
- if [ -f /var/run/confirm ]; then |
173 |
- confirm $subsys |
174 |
- test $? = 1 && continue |
175 |
- fi |
176 |
- |
177 |
- update_boot_stage "$subsys" |
178 |
- # Bring the subsystem up. |
179 |
- if [ "$subsys" = "halt" -o "$subsys" = "reboot" ]; then |
180 |
- export LC_ALL=C |
181 |
- exec $i start |
182 |
- fi |
183 |
- if LC_ALL=C egrep -q "^..*init.d/functions" $i \ |
184 |
- || [ "$subsys" = "single" -o "$subsys" = "local" ]; then |
185 |
- $i start |
186 |
- else |
187 |
- action $"Starting $subsys: " $i start |
188 |
- fi |
189 |
-done |
190 |
-rm -f /var/run/confirm |
191 |
-if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then |
192 |
- /usr/bin/rhgb-client --quit |
193 |
-fi |
194 |
- |