From: Chris Lawrence Date: Sat, 12 Aug 2006 04:41:53 +0000 (-0500) Subject: lsb 3.1-14 Debian release. X-Git-Tag: archive/raspbian/10.2018112800+rpi1^2~238 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c5b67fbc97b57b7cde62e9ac94dab35691ab4f2a;p=lsb.git lsb 3.1-14 Debian release. --- diff --git a/debian/changelog b/debian/changelog index 2ad5b60..3937a92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +lsb (3.1-14) unstable; urgency=low + + * Document LSB init functions more thoroughly in lsb-base's README.Debian. + (Closes: #382597) + + -- Chris Lawrence Fri, 11 Aug 2006 23:41:53 -0500 + +lsb (3.1-13) unstable; urgency=low + + * More tweaks to the getopts calls, to ensure that OPTIND is reset on + each call. (See #381822) + + -- Chris Lawrence Wed, 9 Aug 2006 22:09:42 -0500 + lsb (3.1-12) unstable; urgency=low * Revert log_end_msg() change. (Closes: #381814) diff --git a/debian/lsb-base.README.Debian b/debian/lsb-base.README.Debian index 93cd0a0..b97ce11 100644 --- a/debian/lsb-base.README.Debian +++ b/debian/lsb-base.README.Debian @@ -17,11 +17,15 @@ permit simplified logging of init script actions. Log startup of a second daemon (e.g. sysklogd, nfs init scripts). On Debian, outputs " daemon2d" and leaves the cursor at the EOL. - - log_end_msg 0 + - log_end_msg 0/1 Log successful startup. On Debian, outputs "." followed by newline. - 1 may also be specified, which indicates failure; currently implemented - as outputting "failed!" (in red on a color TTY) followed by newline. + A non-zero code may also be specified, which indicates failure; + currently implemented as outputting "failed!" (in red on a color + TTY) followed by newline. + + Unsucessful startup will cause the specified failure code to be + returned by this function. - log_action_msg "Setting VARIABLE to VALUE" @@ -63,28 +67,51 @@ A deprecated function, log_start_msg, is also provided for compatibility with a few older packages and a derived distribution. This may eventually disappear. -This package also includes the LSB-specified functions: +To use these functions, source /lib/lsb/init-functions at the +beginning of your (Bourne sh or compatible) init script. -log_success_msg -log_failure_msg -log_warning_msg +Please depend on lsb-base (>= 3.0-6) to ensure all of these +functions are available for your init scripts. + +LSB LOGGING FUNCTIONS + +This package also includes the LSB-specified logging functions: + +log_success_msg message +log_failure_msg message +log_warning_msg message These functions *do not* comply with Debian policy and should only be used by LSB packages. -To use these functions, source /lib/lsb/init-functions at the -beginning of your (Bourne sh or compatible) init script. +OTHER LSB FUNCTIONALITY -Please depend on lsb-base (>= 3.0-6) to ensure all of these -functions are available for your init scripts. +start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] + Start "pathname" as a daemon. We call Debian's start-stop-daemon to + implement this functionality. + +killproc [-p pidfile] pathname [signal] + Stops "pathname" (using "pidfile", if specified, to find the process ID). + +pidofproc [-p pidfile] pathname + Find the process ID of pathname. + +For full documentation, please refer to: + +http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html + +Note: Debian packages probably should use start-stop-daemon directly; +however, these functions may be useful in porting init scripts from +other distributions. -CUSTOMIZING OUTPUT +CUSTOMIZING LOGGING OUTPUT If it exists, /etc/lsb-base-logging.sh will be sourced by /lib/lsb/init-functions. You may override any of the log_* functions in this file. The intent is for this file to be supplied as a conffile by derived distributions wishing to log init script events in -a different way. +a different way; this may also be useful on systems where the console +log is not visible during startup. If supplied, this script fragment should be compatible with any Debian /bin/sh, as init scripts sourcing this file may be running under any @@ -92,4 +119,4 @@ Bourne-style shell permitted by Debian policy (i.e. not just bash). "Fancy output" can be overriden by setting FANCYTTY=0 in this file. - -- Chris Lawrence , Sat Sep 24 19:15:02 2005 + -- Chris Lawrence , Fri, 11 Aug 2006 23:38:28 -0500 diff --git a/init-functions b/init-functions index 3493f52..028f88a 100644 --- a/init-functions +++ b/init-functions @@ -33,6 +33,7 @@ start_daemon () { nice=0 pidfile=/dev/null + OPTIND=1 while getopts fn:p: opt ; do case "$opt" in f) force=1;; @@ -59,8 +60,9 @@ pidofproc () { local pidfile line i pids= status specified pid pidfile= specified= - - while getopts p:- opt ; do + + OPTIND=1 + while getopts p: opt ; do case $opt in p) pidfile="$OPTARG"; specified=1;; esac @@ -97,7 +99,8 @@ killproc () { pidfile= specified= - while getopts p:- opt ; do + OPTIND=1 + while getopts p: opt ; do case $i in p) pidfile="$OPTARG"; specified=1;; esac