Index: libexec/rc/rc.subr =================================================================== --- libexec/rc/rc.subr +++ libexec/rc/rc.subr @@ -804,7 +804,8 @@ # # ${name}_prepend n Command added before ${command}. # -# ${name}_setup n Command executed before ${command}. +# ${name}_setup n Command executed during a (re)start before +# ${command} or a reload before ${sig_reload}. # # ${name}_login_class n Login class to use, else "daemon". # @@ -1202,6 +1203,12 @@ _run_rc_precmd || return 1 + if [ -n "$_setup" ]; then + if ! _run_rc_doit "$_setup"; then + warn "failed to setup ${name}" + fi + fi + _doit=$(_run_rc_killcmd "${sig_reload:-HUP}") _run_rc_doit "$_doit" || return 1