diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1059,12 +1059,12 @@ if [ -n "$_env" ]; then eval "export -- $_env" fi - _run_rc_precmd || return 1 # service can redefine all so check for valid targets if [ "$rc_arg" = 'start' -o "$rc_arg" = 'restart' -o \ "$rc_arg" = 'reload' ]; then _run_rc_setup || warn "failed to setup ${name}" fi + _run_rc_precmd || return 1 _run_rc_doit "$_cmd $rc_extra_args" || return 1 _run_rc_postcmd return $_return @@ -1124,14 +1124,16 @@ return 1 fi + _run_rc_setup || warn "failed to setup ${name}" + if ! _run_rc_precmd; then warn "failed precmd routine for ${name}" return 1 fi - # setup the full command to run - # - startmsg "Starting ${name}." + # setup the full command to run + # + check_startmsgs && echo "Starting ${name}." if [ -n "$_chroot" ]; then _cd= _doit="\ @@ -1160,8 +1162,6 @@ fi fi - _run_rc_setup || warn "failed to setup ${name}" - # Prepend default limits _doit="$_cd limits -C $_login_class $_limits $_doit" @@ -1205,10 +1205,10 @@ return 1 fi - _run_rc_precmd || return 1 - _run_rc_setup || warn "failed to setup ${name}" + _run_rc_precmd || return 1 + _doit=$(_run_rc_killcmd "${sig_reload:-HUP}") _run_rc_doit "$_doit" || return 1