diff --git a/init.d.BSD/moused b/init.d.BSD/moused index 1eb1d1f0..2fb36261 100644 --- a/init.d.BSD/moused +++ b/init.d.BSD/moused @@ -67,7 +67,7 @@ start() { local ttyv= for ttyv in /dev/ttyv*; do vidcontrol < "${ttyv}" ${MOUSE_CHAR_START} -m on - : $((${retval} += $?)) + : $((retval+= $?)) done eend ${retval} "Failed to start moused" diff --git a/init.d.BSD/powerd b/init.d.BSD/powerd index 4924b18e..a97e2e02 100644 --- a/init.d.BSD/powerd +++ b/init.d.BSD/powerd @@ -31,6 +31,7 @@ name="Power Control Daemon" depend() { need localmount + use logger after bootmisc } diff --git a/init.d.BSD/rc-enabled b/init.d.BSD/rc-enabled index 239705e6..9ab95d5e 100644 --- a/init.d.BSD/rc-enabled +++ b/init.d.BSD/rc-enabled @@ -35,20 +35,38 @@ start() { [ -x "$svc" ] || continue service=$(basename ${svc}) + # Skip these services + for s in cleartmp moused; do + [ "${s}" = "${service}" ] && continue 2 + done + # If we have an init script for this service, continue - [ -x /etc/init.d/${svc} ]] && continue - [ -x /usr/local/etc/init.d/${svc} ] && continue + [ -x /etc/init.d/"${service}" ] && continue + [ -x /usr/local/etc/init.d/"${service}" ] && continue # Ensure that the users rc.conf will start us - ignore the defaults - eval enabled=\$$(basename ${svc})_enabled + eval enabled=\$$(basename "${svc}")_enable case "$enabled" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; *) continue ;; esac # Good to go! - "$svc" start + "$svc" start && started="${started} ${svc}" : $((retval += $?)) done - eend $retval "Some local rc services failed to start" + save_options started "${started}" + eend $retval "Some local rc services failed to start" + return 0 +} + +stop() { + ebegin "Stopping local rc services" + local svc= retval=0 + for svc in $(rcorder $(get_options started) 2>/dev/null | sort -r); do + "${svc}" stop + : $((retval += $?)) + done + eend $retval "Some local rc services failed to stop" + return 0 } diff --git a/init.d.BSD/syscons b/init.d.BSD/syscons index b74051c5..5fc0e7ce 100644 --- a/init.d.BSD/syscons +++ b/init.d.BSD/syscons @@ -29,11 +29,10 @@ depend() { start() { if [ -n "${MODE}" ]; then - ebegin "Setting mode to ${MODE}" - local tty= - for tty in /dev/tty*; do - [ -e "${tty}" ] || continue - vidcontrol "${MODE}" <"${tty}" >"${tty}" 2>&1 + ebegin "Setting mode to ${MODE} for all screens" + for v in /dev/ttyv*; do + [ -c "${v}" ] || continue + vidcontrol "${MODE}" <"${v}" done eend $? fi @@ -96,7 +95,8 @@ start() { if [ -n "${KBDFLAGS}" ]; then ebegin "Setting keyboard flags for all screens" for v in /dev/ttyv*; do - kbdcontrol ${KBDFLAGS} <${v} &>${v} + [ -c "${v}" ] || continue + kbdcontrol ${KBDFLAGS} <"${v}" done eend $? fi