Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.subr
Show First 20 Lines • Show All 1,395 Lines • ▼ Show 20 Lines | unset name command command_args command_interpreter \ | ||||
required_vars | required_vars | ||||
eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd | eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd | ||||
rc_service="$_file" | rc_service="$_file" | ||||
case "$_file" in | case "$_file" in | ||||
/etc/rc.d/*.sh) # no longer allowed in the base | /etc/rc.d/*.sh) # no longer allowed in the base | ||||
warn "Ignoring old-style startup script $_file" | warn "Ignoring old-style startup script $_file" | ||||
;; | ;; | ||||
*[~#]|*.OLD|*.bak|*.orig|*,v) # scratch file; skip | *[~#]|*.OLD|*.bak|*.orig|*,v|*.pkgsave|*.pkgnew) # scratch file; skip | ||||
warn "Ignoring scratch file $_file" | warn "Ignoring scratch file $_file" | ||||
;; | ;; | ||||
*) # run in subshell | *) # run in subshell | ||||
if [ -x $_file ]; then | if [ -x $_file ]; then | ||||
if [ -n "$rc_fast_and_loose" ]; then | if [ -n "$rc_fast_and_loose" ]; then | ||||
set $_arg; . $_file | set $_arg; . $_file | ||||
else | else | ||||
( trap "echo Script $_file interrupted >&2 ; kill -QUIT $$" 3 | ( trap "echo Script $_file interrupted >&2 ; kill -QUIT $$" 3 | ||||
▲ Show 20 Lines • Show All 621 Lines • ▼ Show 20 Lines | if [ -d "${dir}" ]; then | ||||
*.sample) ;; | *.sample) ;; | ||||
*) if [ -x "$file" ]; then | *) if [ -x "$file" ]; then | ||||
local_rc="${local_rc} ${file}" | local_rc="${local_rc} ${file}" | ||||
fi | fi | ||||
;; | ;; | ||||
esac | esac | ||||
done | done | ||||
fi | fi | ||||
done | |||||
} | |||||
find_system_scripts() { | |||||
system_rc='' | |||||
for file in /etc/rc.d/*; do | |||||
case "${file##*/}" in | |||||
*.pkgsave) ;; | |||||
*) if [ -x "$file" ]; then | |||||
system_rc="${system_rc} ${file}" | |||||
fi | |||||
;; | |||||
esac | |||||
done | done | ||||
} | } | ||||
# check_required_{before|after} command | # check_required_{before|after} command | ||||
# Check for things required by the command before and after its precmd, | # Check for things required by the command before and after its precmd, | ||||
# respectively. The two separate functions are needed because some | # respectively. The two separate functions are needed because some | ||||
# conditions should prevent precmd from being run while other things | # conditions should prevent precmd from being run while other things | ||||
# depend on precmd having already been run. | # depend on precmd having already been run. | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |