diff options
author | dougb <dougb@FreeBSD.org> | 2005-12-02 20:06:07 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2005-12-02 20:06:07 +0000 |
commit | 997405c1cadb59927aff9fe3f831061a3a60fcae (patch) | |
tree | 51bcd0baa3852d62ab93efd232c48f0a2015ed8a /etc/rc.subr | |
parent | f88100d008c54fc484c3dc2634b2079c11aea469 (diff) | |
download | FreeBSD-src-997405c1cadb59927aff9fe3f831061a3a60fcae.zip FreeBSD-src-997405c1cadb59927aff9fe3f831061a3a60fcae.tar.gz |
Introduce startup scripts from the local_startup directories to
the base rcorder. This is accomplished by running rcorder twice,
first to get all the disks mounted (through mountcritremote),
then again to include the local_startup directories.
This dramatically changes the behavior of rc.d/localpkg, as
all "local" scripts that have the new rc.d semantics are now
run in the base rcorder, so only scripts that have not been
converted yet will run in rc.d/localpkg.
Make a similar change in rc.shutdown, and add some functions in
rc.subr to support these changes.
Bump __FreeBSD_version to reflect this change.
Diffstat (limited to 'etc/rc.subr')
-rw-r--r-- | etc/rc.subr | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index ff88433..d3d52b7 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -1355,4 +1355,42 @@ geli_make_list() echo ${devices2} } +# Find scripts in local_startup directories that use the old syntax +# +find_local_scripts_old () { + zlist='' + slist='' + for dir in ${local_startup}; do + if [ -d "${dir}" ]; then + for file in ${dir}/[0-9]*.sh; do + grep '^# PROVIDE:' $file >/dev/null 2>&1 && + continue + zlist="$zlist $file" + done + for file in ${dir}/[^0-9]*.sh; do + grep '^# PROVIDE:' $file >/dev/null 2>&1 && + continue + slist="$slist $file" + done + fi + done +} + +find_local_scripts_new () { + local_rc='' + for dir in ${local_startup}; do + if [ -d "${dir}" ]; then + for file in `grep -l '^# PROVIDE:' ${dir}/*`; do + case "$file" in + *.sample) ;; + *) if [ -x "$file" ]; then + local_rc="${local_rc} ${file}" + fi + ;; + esac + done + fi + done +} + fi |