Small improvement of rc script makes big difference (bug report 35898)

Simon Perreault nomis80 at videotron.ca
Sat Jul 22 10:55:14 PDT 2000


Synopsis:
    A small improvement over rc script makes the [FAILED] and [  OK  ]
things work correctly.

Problem:
    When an error happens in an init script (such as /etc/init.d/sysklogd)
rather than in the program it executes (such as /usr/sbin/syslogd) there is
no red [FAILED] notification, as the evaluate_retval function is only called
in the init script and not in the rc script. When the rc script launches an
init script, it does no error checking on the script itself, assuming it is
fault-less.

Solution:
    Have the rc script evaluate the return value of each init script for a
fault in the script itself. Some modifications:
    1) Source the /etc/init.d/functions file.
    2) Evaluate the return value of each startup() call. On error, call
"print_status failure". On success, do nothing.

Further reading:
    My modified rc script is attached to this email (please forgive the DOS
test format, I still have to use Windows for mail).

Comments:
    I tested it, and it works.

--
Mail archive: http://www.pcrdallas.com/mail-archives/lfs-discuss
IRC access: server: irc.linuxfromscratch.org port: 6667 channel: #LFS
Unsubscribe: email lfs-discuss-request at linuxfromscratch.org and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)



More information about the lfs-dev mailing list