local.rc -> rc-enable and ensure that we start all defined services, including system ones

This commit is contained in:
Roy Marples 2007-11-20 17:45:00 +00:00
parent 7048837e3f
commit 6a6ef66d15

View File

@ -25,19 +25,28 @@
depend() { depend() {
need localmount net need localmount net
after $(ls -1 | grep -v local) after $(ls -1 | grep -v local | xargs)
} }
start() { start() {
ebegin "Starting local rc services" ebegin "Starting local rc services"
local svc= enabled= retval=0 local svc= enabled= retval=0 service=
for svc in $(rcorder /usr/local/etc/rc.d/* 2>/dev/null); do for svc in $(rcorder /etc/rc.d/* /usr/local/etc/rc.d/* 2>/dev/null); do
[ -x "$svc" ] || continue [ -x "$svc" ] || continue
service=$(basename ${svc})
# If we have an init script for this service, continue
[ -x /etc/init.d/${svc} ]] && continue
[ -x /usr/local/etc/init.d/${svc} ] && continue
# Ensure that the users rc.conf will start us - ignore the defaults
eval enabled=\$$(basename ${svc})_enabled eval enabled=\$$(basename ${svc})_enabled
case "$enabled" in case "$enabled" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;;
*) continue ;; *) continue ;;
esac esac
# Good to go!
"$svc" start "$svc" start
: $((retval += $?)) : $((retval += $?))
done done