lsb 3.1-14 Debian release.
authorChris Lawrence <lawrencc@debian.org>
Sat, 12 Aug 2006 04:41:53 +0000 (23:41 -0500)
committerDidier Raboud <odyx@debian.org>
Sat, 12 Aug 2006 04:41:53 +0000 (23:41 -0500)
debian/changelog
debian/lsb-base.README.Debian
init-functions

index 2ad5b600dbb9b637556d3c135e0b90647d67dfaa..3937a9281764ea907c98794d4722c803c4e76050 100644 (file)
@@ -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 <lawrencc@debian.org>  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 <lawrencc@debian.org>  Wed,  9 Aug 2006 22:09:42 -0500
+
 lsb (3.1-12) unstable; urgency=low
 
   * Revert log_end_msg() change.  (Closes: #381814)
index 93cd0a02be0ec70641321ea61010284c45e0c911..b97ce11fbd122554f915c77f3136fa434b6ea163 100644 (file)
@@ -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 <lawrencc@debian.org>, Sat Sep 24 19:15:02 2005
+ -- Chris Lawrence <lawrencc@debian.org>, Fri, 11 Aug 2006 23:38:28 -0500
index 3493f5233563a8ddabb8523261d5c3052b151ad3..028f88a97790e443b0eaf33360563b9fefbd4926 100644 (file)
@@ -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