Init script Functions

Each LSB-compliant init.d script must source the file /lib/lsb/init-functions. This file must cause the following shell script commands to be defined. This can be done either by adding a directory to the PATH variable which defines these commands, or by defining sh aliases. While the distribution-provided aliases may choose to use bash extensions (at the distribution's option), the LSB init.d files themselves should only depend in /bin/sh features as defined by POSIX.2.

start_daemon [-f] [-n nicelevel] pathname [args]This runs the specified program as a daemon. start_daemon will check to see if there is a program named "daemon" already running. If so, it will not start another copy of the daemon unless the -f option is given. The -n option specifies a nice level. See nice(1).
killproc basename [signal]This stops the specified program. The program is found using the algorithm given by pidofproc. If a signal is specified, the program is sent that signal. Otherwise, a SIGTERM followed by a SIGKILL after some number of seconds is sent.
pidofproc basenameThis function returns one or more pid(s) for a particular daemon. If an entry is found in /var/run/basename.pid, then that value is returned. Compliant implementations of the LSB may attempt other mechanisms for determining the pid(s), although this is not required (and not recommended, since a user can trick startup scripts by creating processes that appear to be system programs in the process list thus creating a potential security exposure). Hence, LSB-complaint applications who wish to use the pidofproc function in their init scripts must store the pid in /var/run/basename.pid.
log_success_msg "message"This requests the distribution to print a success message. The message should be relatively short; no More than 60 characters is highly desirable.
log_failure_msg "message"This requests the distribution to print a failure message. The message should be relatively short; no more than 60 characters is highly desirable.
log_warning_msg "message"This requests the distribution to print a warning message. The message should be relatively short; no more than 60 characters is highly desirable.