… | |
… | |
15 | : ${CONSOLE:=/dev/console} # default console |
15 | : ${CONSOLE:=/dev/console} # default console |
16 | : ${SUTIMEOUT:=20} # default sulogin timeout (see fatal) |
16 | : ${SUTIMEOUT:=20} # default sulogin timeout (see fatal) |
17 | : ${RCDIR:=/etc} # where SYSVINIT-style rcX.d files are located |
17 | : ${RCDIR:=/etc} # where SYSVINIT-style rcX.d files are located |
18 | : ${SYSVINIT:=0} # defaults for SYSV_EXEC and SYSV_FAC |
18 | : ${SYSVINIT:=0} # defaults for SYSV_EXEC and SYSV_FAC |
19 | : ${SYSV_EXEC=$SYSVINIT} # execute sysv-scripts in $RCDIR/rc?.d/[SK][0-9][0-9]* |
19 | : ${SYSV_EXEC=$SYSVINIT} # execute sysv-scripts in $RCDIR/rc?.d/[SK][0-9][0-9]* |
20 | : ${SYSV_FAC=$SYSVINIT} # scripts in $RCDIR/init.d/* are used overwrite builtins |
20 | : ${SYSV_FAC=$SYSVINIT} # scripts in $RCDIR/init.d/* are used to supplement builtins |
|
|
21 | : ${SYSV_PRI=1} # give sysv scripts priority over lmainit facilities? |
21 | : ${COALESCE:=1} |
22 | : ${COALESCE:=1} |
22 | : ${SULOGIN:=sulogin} |
23 | : ${SULOGIN:=sulogin} |
23 | : ${SINGLESTEP:=0} |
24 | : ${SINGLESTEP:=0} |
24 | |
25 | |
25 | shopt -s extglob |
26 | shopt -s extglob |
… | |
… | |
526 | # create real facilities from them |
527 | # create real facilities from them |
527 | scan_sysv_facs() { |
528 | scan_sysv_facs() { |
528 | for path in $RCDIR/init.d/*; do |
529 | for path in $RCDIR/init.d/*; do |
529 | local fac=${path#$RCDIR/init.d/} |
530 | local fac=${path#$RCDIR/init.d/} |
530 | fac=${fac//[^a-zA-Z0-9_]/_} |
531 | fac=${fac//[^a-zA-Z0-9_]/_} |
|
|
532 | local ref="fac_${fac}_desc" |
|
|
533 | if [ "$SYSV_PRI" -gt 0 -o -z "${!ref}" ]; then |
531 | eval "fac_${fac}_desc"='"$path"' |
534 | eval "fac_${fac}_desc"='"$path"' |
532 | eval " |
535 | eval " |
533 | fac_${fac}_start() { |
536 | fac_${fac}_start() { |
534 | \"$path\" start |
537 | \"$path\" start |
535 | } |
538 | } |
536 | fac_${fac}_stop() { |
539 | fac_${fac}_stop() { |
537 | \"$path\" stop |
540 | \"$path\" stop |
|
|
541 | } |
538 | } |
542 | " |
539 | " |
543 | fi |
540 | done |
544 | done |
541 | } |
545 | } |
542 | |
546 | |
543 | . /etc/rc.values |
547 | . /etc/rc.values |
544 | |
548 | |