functions 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin $rc_base/init.d/functions
  4. #
  5. # Description : Run Level Control Functions
  6. #
  7. # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
  8. #
  9. # Version : 00.00
  10. #
  11. # Notes : With code based on Matthias Benkmann's simpleinit-msb
  12. # http://winterdrache.de/linux/newboot/index.html
  13. #
  14. ########################################################################
  15. ## Environmental setup
  16. # Setup default values for environment
  17. umask 022
  18. export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
  19. # Signal sent to running processes to refresh their configuration
  20. RELOADSIG="HUP"
  21. # Number of seconds between STOPSIG and FALLBACK when stopping processes
  22. KILLDELAY="3"
  23. ## Screen Dimensions
  24. # Find current screen size
  25. if [ -z "${COLUMNS}" ]; then
  26. COLUMNS=$(stty size)
  27. COLUMNS=${COLUMNS##* }
  28. fi
  29. # When using remote connections, such as a serial port, stty size returns 0
  30. if [ "${COLUMNS}" = "0" ]; then
  31. COLUMNS=80
  32. fi
  33. ## Measurements for positioning result messages
  34. COL=$((${COLUMNS} - 8))
  35. WCOL=$((${COL} - 2))
  36. ## Provide an echo that supports -e and -n
  37. # If formatting is needed, $ECHO should be used
  38. case "`echo -e -n test`" in
  39. -[en]*)
  40. ECHO=/bin/echo
  41. ;;
  42. *)
  43. ECHO=echo
  44. ;;
  45. esac
  46. ## Set Cursor Position Commands, used via $ECHO
  47. SET_COL="\\033[${COL}G" # at the $COL char
  48. SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
  49. CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
  50. ## Set color commands, used via $ECHO
  51. # Please consult `man console_codes for more information
  52. # under the "ECMA-48 Set Graphics Rendition" section
  53. #
  54. # Warning: when switching from a 8bit to a 9bit font,
  55. # the linux console will reinterpret the bold (1;) to
  56. # the top 256 glyphs of the 9bit font. This does
  57. # not affect framebuffer consoles
  58. NORMAL="\\033[0;39m" # Standard console grey
  59. SUCCESS="\\033[1;32m" # Success is green
  60. WARNING="\\033[1;33m" # Warnings are yellow
  61. FAILURE="\\033[1;31m" # Failures are red
  62. INFO="\\033[1;36m" # Information is light cyan
  63. BRACKET="\\033[1;34m" # Brackets are blue
  64. STRING_LENGTH="0" # the length of the current message
  65. #*******************************************************************************
  66. # Function - boot_mesg()
  67. #
  68. # Purpose: Sending information from bootup scripts to the console
  69. #
  70. # Inputs: $1 is the message
  71. # $2 is the colorcode for the console
  72. #
  73. # Outputs: Standard Output
  74. #
  75. # Dependencies: - sed for parsing strings.
  76. # - grep for counting string length.
  77. #
  78. # Todo:
  79. #*******************************************************************************
  80. boot_mesg()
  81. {
  82. local ECHOPARM=""
  83. while true
  84. do
  85. case "${1}" in
  86. -n)
  87. ECHOPARM=" -n "
  88. shift 1
  89. ;;
  90. -*)
  91. echo "Unknown Option: ${1}"
  92. return 1
  93. ;;
  94. *)
  95. break
  96. ;;
  97. esac
  98. done
  99. ## Figure out the length of what is to be printed to be used
  100. ## for warning messages.
  101. STRING_LENGTH=$((${#1} + 1))
  102. # Print the message to the screen
  103. ${ECHO} ${ECHOPARM} -e "${2}${1}"
  104. }
  105. boot_mesg_flush()
  106. {
  107. # Reset STRING_LENGTH for next message
  108. STRING_LENGTH="0"
  109. }
  110. boot_log()
  111. {
  112. # Left in for backwards compatibility
  113. :
  114. }
  115. echo_ok()
  116. {
  117. ${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]"
  118. ${ECHO} -e "${NORMAL}"
  119. boot_mesg_flush
  120. }
  121. echo_failure()
  122. {
  123. ${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]"
  124. ${ECHO} -e "${NORMAL}"
  125. boot_mesg_flush
  126. }
  127. echo_warning()
  128. {
  129. ${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]"
  130. ${ECHO} -e "${NORMAL}"
  131. boot_mesg_flush
  132. }
  133. print_error_msg()
  134. {
  135. echo_failure
  136. # $i is inherited by the rc script
  137. boot_mesg -n "FAILURE:\n\nYou should not be reading this error message.\n\n" ${FAILURE}
  138. boot_mesg -n " It means that an unforeseen error took"
  139. boot_mesg -n " place in ${i}, which exited with a return value of"
  140. boot_mesg " ${error_value}.\n"
  141. boot_mesg_flush
  142. boot_mesg -n "If you're able to track this"
  143. boot_mesg -n " error down to a bug in one of the files provided by"
  144. boot_mesg -n " the LFS book, please be so kind to inform us at"
  145. boot_mesg " lfs-dev@linuxfromscratch.org.\n"
  146. boot_mesg_flush
  147. boot_mesg -n "Press Enter to continue..." ${INFO}
  148. boot_mesg "" ${NORMAL}
  149. read ENTER
  150. }
  151. check_script_status()
  152. {
  153. # $i is inherited by the rc script
  154. if [ ! -f ${i} ]; then
  155. boot_mesg "${i} is not a valid symlink." ${WARNING}
  156. echo_warning
  157. continue
  158. fi
  159. if [ ! -x ${i} ]; then
  160. boot_mesg "${i} is not executable, skipping." ${WARNING}
  161. echo_warning
  162. continue
  163. fi
  164. }
  165. evaluate_retval()
  166. {
  167. error_value="${?}"
  168. if [ ${error_value} = 0 ]; then
  169. echo_ok
  170. else
  171. echo_failure
  172. fi
  173. # This prevents the 'An Unexpected Error Has Occurred' from trivial
  174. # errors.
  175. return 0
  176. }
  177. print_status()
  178. {
  179. if [ "${#}" = "0" ]; then
  180. echo "Usage: ${0} {success|warning|failure}"
  181. return 1
  182. fi
  183. case "${1}" in
  184. success)
  185. echo_ok
  186. ;;
  187. warning)
  188. # Leave this extra case in because old scripts
  189. # may call it this way.
  190. case "${2}" in
  191. running)
  192. ${ECHO} -e -n "${CURS_UP}"
  193. ${ECHO} -e -n "\\033[${STRING_LENGTH}G "
  194. boot_mesg "Already running." ${WARNING}
  195. echo_warning
  196. ;;
  197. not_running)
  198. ${ECHO} -e -n "${CURS_UP}"
  199. ${ECHO} -e -n "\\033[${STRING_LENGTH}G "
  200. boot_mesg "Not running." ${WARNING}
  201. echo_warning
  202. ;;
  203. not_available)
  204. ${ECHO} -e -n "${CURS_UP}"
  205. ${ECHO} -e -n "\\033[${STRING_LENGTH}G "
  206. boot_mesg "Not available." ${WARNING}
  207. echo_warning
  208. ;;
  209. *)
  210. # This is how it is supposed to
  211. # be called
  212. echo_warning
  213. ;;
  214. esac
  215. ;;
  216. failure)
  217. echo_failure
  218. ;;
  219. esac
  220. }
  221. reloadproc()
  222. {
  223. local pidfile=""
  224. local failure=0
  225. while true
  226. do
  227. case "${1}" in
  228. -p)
  229. pidfile="${2}"
  230. shift 2
  231. ;;
  232. -*)
  233. log_failure_msg "Unknown Option: ${1}"
  234. return 2
  235. ;;
  236. *)
  237. break
  238. ;;
  239. esac
  240. done
  241. if [ "${#}" -lt "1" ]; then
  242. log_failure_msg "Usage: reloadproc [-p pidfile] pathname"
  243. return 2
  244. fi
  245. # This will ensure compatibility with previous LFS Bootscripts
  246. if [ -n "${PIDFILE}" ]; then
  247. pidfile="${PIDFILE}"
  248. fi
  249. # Is the process running?
  250. if [ -z "${pidfile}" ]; then
  251. pidofproc -s "${1}"
  252. else
  253. pidofproc -s -p "${pidfile}" "${1}"
  254. fi
  255. # Warn about stale pid file
  256. if [ "$?" = 1 ]; then
  257. boot_mesg -n "Removing stale pid file: ${pidfile}. " ${WARNING}
  258. rm -f "${pidfile}"
  259. fi
  260. if [ -n "${pidlist}" ]; then
  261. for pid in ${pidlist}
  262. do
  263. kill -"${RELOADSIG}" "${pid}" || failure="1"
  264. done
  265. (exit ${failure})
  266. evaluate_retval
  267. else
  268. boot_mesg "Process ${1} not running." ${WARNING}
  269. echo_warning
  270. fi
  271. }
  272. statusproc()
  273. {
  274. local pidfile=""
  275. local base=""
  276. local ret=""
  277. while true
  278. do
  279. case "${1}" in
  280. -p)
  281. pidfile="${2}"
  282. shift 2
  283. ;;
  284. -*)
  285. log_failure_msg "Unknown Option: ${1}"
  286. return 2
  287. ;;
  288. *)
  289. break
  290. ;;
  291. esac
  292. done
  293. if [ "${#}" != "1" ]; then
  294. shift 1
  295. log_failure_msg "Usage: statusproc [-p pidfile] pathname"
  296. return 2
  297. fi
  298. # Get the process basename
  299. base="${1##*/}"
  300. # This will ensure compatibility with previous LFS Bootscripts
  301. if [ -n "${PIDFILE}" ]; then
  302. pidfile="${PIDFILE}"
  303. fi
  304. # Is the process running?
  305. if [ -z "${pidfile}" ]; then
  306. pidofproc -s "${1}"
  307. else
  308. pidofproc -s -p "${pidfile}" "${1}"
  309. fi
  310. # Store the return status
  311. ret=$?
  312. if [ -n "${pidlist}" ]; then
  313. ${ECHO} -e "${INFO}${base} is running with Process"\
  314. "ID(s) ${pidlist}.${NORMAL}"
  315. else
  316. if [ -n "${base}" -a -e "/var/run/${base}.pid" ]; then
  317. ${ECHO} -e "${WARNING}${1} is not running but"\
  318. "/var/run/${base}.pid exists.${NORMAL}"
  319. else
  320. if [ -n "${pidfile}" -a -e "${pidfile}" ]; then
  321. ${ECHO} -e "${WARNING}${1} is not running"\
  322. "but ${pidfile} exists.${NORMAL}"
  323. else
  324. ${ECHO} -e "${INFO}${1} is not running.${NORMAL}"
  325. fi
  326. fi
  327. fi
  328. # Return the status from pidofproc
  329. return $ret
  330. }
  331. # The below functions are documented in the LSB-generic 2.1.0
  332. #*******************************************************************************
  333. # Function - pidofproc [-s] [-p pidfile] pathname
  334. #
  335. # Purpose: This function returns one or more pid(s) for a particular daemon
  336. #
  337. # Inputs: -p pidfile, use the specified pidfile instead of pidof
  338. # pathname, path to the specified program
  339. #
  340. # Outputs: return 0 - Success, pid's in stdout
  341. # return 1 - Program is dead, pidfile exists
  342. # return 2 - Invalid or excessive number of arguments,
  343. # warning in stdout
  344. # return 3 - Program is not running
  345. #
  346. # Dependencies: pidof, echo, head
  347. #
  348. # Todo: Remove dependency on head
  349. # This depreciates getpids
  350. # Test changes to pidof
  351. #
  352. #*******************************************************************************
  353. pidofproc()
  354. {
  355. local pidfile=""
  356. local lpids=""
  357. local silent=""
  358. pidlist=""
  359. while true
  360. do
  361. case "${1}" in
  362. -p)
  363. pidfile="${2}"
  364. shift 2
  365. ;;
  366. -s)
  367. # Added for legacy opperation of getpids
  368. # eliminates several '> /dev/null'
  369. silent="1"
  370. shift 1
  371. ;;
  372. -*)
  373. log_failure_msg "Unknown Option: ${1}"
  374. return 2
  375. ;;
  376. *)
  377. break
  378. ;;
  379. esac
  380. done
  381. if [ "${#}" != "1" ]; then
  382. shift 1
  383. log_failure_msg "Usage: pidofproc [-s] [-p pidfile] pathname"
  384. return 2
  385. fi
  386. if [ -n "${pidfile}" ]; then
  387. if [ ! -r "${pidfile}" ]; then
  388. return 3 # Program is not running
  389. fi
  390. lpids=`head -n 1 ${pidfile}`
  391. for pid in ${lpids}
  392. do
  393. if [ "${pid}" -ne "$$" -a "${pid}" -ne "${PPID}" ]; then
  394. kill -0 "${pid}" 2>/dev/null &&
  395. pidlist="${pidlist} ${pid}"
  396. fi
  397. if [ "${silent}" != "1" ]; then
  398. echo "${pidlist}"
  399. fi
  400. test -z "${pidlist}" &&
  401. # Program is dead, pidfile exists
  402. return 1
  403. # else
  404. return 0
  405. done
  406. else
  407. pidlist=`pidof -o $$ -o $PPID -x "$1"`
  408. if [ "${silent}" != "1" ]; then
  409. echo "${pidlist}"
  410. fi
  411. # Get provide correct running status
  412. if [ -n "${pidlist}" ]; then
  413. return 0
  414. else
  415. return 3
  416. fi
  417. fi
  418. if [ "$?" != "0" ]; then
  419. return 3 # Program is not running
  420. fi
  421. }
  422. # This will ensure compatibility with previous LFS Bootscripts
  423. getpids()
  424. {
  425. if [ -z "${PIDFILE}" ]; then
  426. pidofproc -s -p "${PIDFILE}" $@
  427. else
  428. pidofproc -s $@
  429. fi
  430. base="${1##*/}"
  431. }
  432. #*******************************************************************************
  433. # Function - loadproc [-f] [-n nicelevel] [-p pidfile] pathname [args]
  434. #
  435. # Purpose: This runs the specified program as a daemon
  436. #
  437. # Inputs: -f, run the program even if it is already running
  438. # -n nicelevel, specifies a nice level. See nice(1).
  439. # -p pidfile, uses the specified pidfile
  440. # pathname, pathname to the specified program
  441. # args, arguments to pass to specified program
  442. #
  443. # Outputs: return 0 - Success
  444. # return 2 - Invalid of excessive number of arguments,
  445. # warning in stdout
  446. # return 4 - Program or service status is unknown
  447. #
  448. # Dependencies: nice, rm
  449. #
  450. # Todo: LSB says this should be called start_daemon
  451. # LSB does not say that it should call evaluate_retval
  452. # It checks for PIDFILE, which is deprecated.
  453. # Will be removed after BLFS 6.0
  454. # loadproc returns 0 if program is already running, not LSB compliant
  455. #
  456. #*******************************************************************************
  457. loadproc()
  458. {
  459. local pidfile=""
  460. local forcestart=""
  461. local nicelevel="10"
  462. # This will ensure compatibility with previous LFS Bootscripts
  463. if [ -n "${PIDFILE}" ]; then
  464. pidfile="${PIDFILE}"
  465. fi
  466. while true
  467. do
  468. case "${1}" in
  469. -f)
  470. forcestart="1"
  471. shift 1
  472. ;;
  473. -n)
  474. nicelevel="${2}"
  475. shift 2
  476. ;;
  477. -p)
  478. pidfile="${2}"
  479. shift 2
  480. ;;
  481. -*)
  482. log_failure_msg "Unknown Option: ${1}"
  483. return 2 #invalid or excess argument(s)
  484. ;;
  485. *)
  486. break
  487. ;;
  488. esac
  489. done
  490. if [ "${#}" = "0" ]; then
  491. log_failure_msg "Usage: loadproc [-f] [-n nicelevel] [-p pidfile] pathname [args]"
  492. return 2 #invalid or excess argument(s)
  493. fi
  494. if [ -z "${forcestart}" ]; then
  495. if [ -z "${pidfile}" ]; then
  496. pidofproc -s "${1}"
  497. else
  498. pidofproc -s -p "${pidfile}" "${1}"
  499. fi
  500. case "${?}" in
  501. 0)
  502. log_warning_msg "Unable to continue: ${1} is running"
  503. return 0 # 4
  504. ;;
  505. 1)
  506. boot_mesg "Removing stale pid file: ${pidfile}" ${WARNING}
  507. rm -f "${pidfile}"
  508. ;;
  509. 3)
  510. ;;
  511. *)
  512. log_failure_msg "Unknown error code from pidofproc: ${?}"
  513. return 4
  514. ;;
  515. esac
  516. fi
  517. nice -n "${nicelevel}" "${@}"
  518. evaluate_retval # This is "Probably" not LSB compliant,
  519. # but required to be compatible with older bootscripts
  520. return 0
  521. }
  522. #*******************************************************************************
  523. # Function - killproc [-p pidfile] pathname [signal]
  524. #
  525. # Purpose:
  526. #
  527. # Inputs: -p pidfile, uses the specified pidfile
  528. # pathname, pathname to the specified program
  529. # signal, send this signal to pathname
  530. #
  531. # Outputs: return 0 - Success
  532. # return 2 - Invalid of excessive number of arguments,
  533. # warning in stdout
  534. # return 4 - Unknown Status
  535. #
  536. # Dependencies: kill, rm
  537. #
  538. # Todo: LSB does not say that it should call evaluate_retval
  539. # It checks for PIDFILE, which is deprecated.
  540. # Will be removed after BLFS 6.0
  541. #
  542. #*******************************************************************************
  543. killproc()
  544. {
  545. local pidfile=""
  546. local killsig=TERM # default signal is SIGTERM
  547. pidlist=""
  548. # This will ensure compatibility with previous LFS Bootscripts
  549. if [ -n "${PIDFILE}" ]; then
  550. pidfile="${PIDFILE}"
  551. fi
  552. while true
  553. do
  554. case "${1}" in
  555. -p)
  556. pidfile="${2}"
  557. shift 2
  558. ;;
  559. -*)
  560. log_failure_msg "Unknown Option: ${1}"
  561. return 2
  562. ;;
  563. *)
  564. break
  565. ;;
  566. esac
  567. done
  568. if [ "${#}" = "2" ]; then
  569. killsig="${2}"
  570. elif [ "${#}" != "1" ]; then
  571. shift 2
  572. log_failure_msg "Usage: killproc [-p pidfile] pathname [signal]"
  573. return 2
  574. fi
  575. # Is the process running?
  576. if [ -z "${pidfile}" ]; then
  577. pidofproc -s "${1}"
  578. else
  579. pidofproc -s -p "${pidfile}" "${1}"
  580. fi
  581. # Remove stale pidfile
  582. if [ "$?" = 1 ]; then
  583. boot_mesg "Removing stale pid file: ${pidfile}." ${WARNING}
  584. rm -f "${pidfile}"
  585. fi
  586. # If running, send the signal
  587. if [ -n "${pidlist}" ]; then
  588. for pid in ${pidlist}
  589. do
  590. kill -${killsig} ${pid} 2>/dev/null
  591. # Wait up to 3 seconds, for ${pid} to terminate
  592. case "${killsig}" in
  593. TERM|SIGTERM|KILL|SIGKILL)
  594. # sleep in 1/10ths of seconds and
  595. # multiply KILLDELAY by 10
  596. local dtime="${KILLDELAY}0"
  597. while [ "${dtime}" != "0" ]
  598. do
  599. kill -0 ${pid} 2>/dev/null || break
  600. sleep 0.1
  601. dtime=$(( ${dtime} - 1))
  602. done
  603. # If ${pid} is still running, kill it
  604. kill -0 ${pid} 2>/dev/null && kill -KILL ${pid} 2>/dev/null
  605. ;;
  606. esac
  607. done
  608. # Check if the process is still running if we tried to stop it
  609. case "${killsig}" in
  610. TERM|SIGTERM|KILL|SIGKILL)
  611. if [ -z "${pidfile}" ]; then
  612. pidofproc -s "${1}"
  613. else
  614. pidofproc -s -p "${pidfile}" "${1}"
  615. fi
  616. # Program was terminated
  617. if [ "$?" != "0" ]; then
  618. # Remove the pidfile if necessary
  619. if [ -f "${pidfile}" ]; then
  620. rm -f "${pidfile}"
  621. fi
  622. echo_ok
  623. return 0
  624. else # Program is still running
  625. echo_failure
  626. return 4 # Unknown Status
  627. fi
  628. ;;
  629. *)
  630. # Just see if the kill returned successfully
  631. evaluate_retval
  632. ;;
  633. esac
  634. else # process not running
  635. print_status warning not_running
  636. fi
  637. }
  638. #*******************************************************************************
  639. # Function - log_success_msg "message"
  640. #
  641. # Purpose: Print a success message
  642. #
  643. # Inputs: $@ - Message
  644. #
  645. # Outputs: Text output to screen
  646. #
  647. # Dependencies: echo
  648. #
  649. # Todo: logging
  650. #
  651. #*******************************************************************************
  652. log_success_msg()
  653. {
  654. ${ECHO} -n -e "${BOOTMESG_PREFIX}${@}"
  655. ${ECHO} -e "${SET_COL}""${BRACKET}""[""${SUCCESS}"" OK ""${BRACKET}""]""${NORMAL}"
  656. return 0
  657. }
  658. #*******************************************************************************
  659. # Function - log_failure_msg "message"
  660. #
  661. # Purpose: Print a failure message
  662. #
  663. # Inputs: $@ - Message
  664. #
  665. # Outputs: Text output to screen
  666. #
  667. # Dependencies: echo
  668. #
  669. # Todo: logging
  670. #
  671. #*******************************************************************************
  672. log_failure_msg() {
  673. ${ECHO} -n -e "${BOOTMESG_PREFIX}${@}"
  674. ${ECHO} -e "${SET_COL}""${BRACKET}""[""${FAILURE}"" FAIL ""${BRACKET}""]""${NORMAL}"
  675. return 0
  676. }
  677. #*******************************************************************************
  678. # Function - log_warning_msg "message"
  679. #
  680. # Purpose: print a warning message
  681. #
  682. # Inputs: $@ - Message
  683. #
  684. # Outputs: Text output to screen
  685. #
  686. # Dependencies: echo
  687. #
  688. # Todo: logging
  689. #
  690. #*******************************************************************************
  691. log_warning_msg() {
  692. ${ECHO} -n -e "${BOOTMESG_PREFIX}${@}"
  693. ${ECHO} -e "${SET_COL}""${BRACKET}""[""${WARNING}"" WARN ""${BRACKET}""]""${NORMAL}"
  694. return 0
  695. }
  696. # End $rc_base/init.d/functions