diff options
author | Roy Marples <roy@marples.name> | 2007-11-21 15:46:56 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-11-21 15:46:56 +0000 |
commit | 41c00eda37298bbc88ae79dd701eaa444659f995 (patch) | |
tree | 05d26de742431abea7191cc29e1500cf3488a7db /init.d.BSD/rc-enabled | |
parent | 872a31b2158ee65ad07e6ba04e366624af2d0fa5 (diff) |
misc BSD fixes
Diffstat (limited to 'init.d.BSD/rc-enabled')
-rw-r--r-- | init.d.BSD/rc-enabled | 28 |
1 files changed, 23 insertions, 5 deletions
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 + 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 start" + eend $retval "Some local rc services failed to stop" + return 0 } |