summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/rc-services.sh')
-rwxr-xr-xsbin/rc-services.sh29
1 files changed, 26 insertions, 3 deletions
diff --git a/sbin/rc-services.sh b/sbin/rc-services.sh
index 45076e3..26cd7dc 100755
--- a/sbin/rc-services.sh
+++ b/sbin/rc-services.sh
@@ -405,12 +405,14 @@ start_service() {
# if we can not start the services in parallel
# then just start it and return the exit status
( "/etc/init.d/${service}" start )
+ service_started "${service}" || service_inactive "${service}"
retval=$?
return "${retval}"
else
# if parallel startup is allowed, start it in background
(
- "/etc/init.d/${service}" start
+ "/etc/init.d/${service}" start
+ service_started "${service}" || service_inactive "${service}"
retval=$?
) &
return 0
@@ -448,18 +450,31 @@ stop_service() {
# if we can not start the services in parallel
# then just start it and return the exit status
( "/etc/init.d/${service}" stop )
+ service_stopped "${service}"
retval=$?
return "${retval}"
else
# if parallel startup is allowed, start it in background
(
( "/etc/init.d/${service}" stop )
+ service_stopped "${service}"
retval=$?
) &
return 0
fi
}
+# bool mark_service_coldplugged(service)
+#
+# Mark 'service' as coldplugged.
+#
+mark_service_coldplugged() {
+ [[ -z $1 ]] && return 1
+
+ ln -snf "/etc/init.d/$1" "${svcdir}/coldplugged/$1"
+ return 0
+}
+
# bool mark_service_starting(service)
#
# Mark 'service' as starting.
@@ -532,7 +547,8 @@ mark_service_stopped() {
rm -Rf "${svcdir}/daemons/$1" "${svcdir}/starting/$1" \
"${svcdir}/started/$1" "${svcdir}/inactive/$1" \
"${svcdir}/wasinactive/$1" "${svcdir}/stopping/$1" \
- "${svcdir}/scheduled/$1" "${svcdir}/options/$1"
+ "${svcdir}/scheduled/$1" "${svcdir}/options/$1" \
+ "${svcdir}/coldplugged/$1"
return 0
}
@@ -553,6 +569,14 @@ test_service_state() {
return 1
}
+# bool service_coldplugged(service)
+#
+# Returns true if 'service' is coldplugged
+#
+service_coldplugged() {
+ test_service_state "$1" "coldplugged"
+}
+
# bool service_starting(service)
#
# Returns true if 'service' is starting
@@ -712,7 +736,6 @@ valid_i() {
${x} == "net" ]] \
&& echo "${x}"
done
-
return 0
}