lsb 3.1-16 Debian release.
authorChris Lawrence <lawrencc@debian.org>
Wed, 27 Sep 2006 23:10:12 +0000 (18:10 -0500)
committerDidier Raboud <odyx@debian.org>
Wed, 27 Sep 2006 23:10:12 +0000 (18:10 -0500)
debian/TODO
debian/changelog
debian/lsb-base.README.Debian
debian/lsb-release.dirs
debian/rules
init-functions

index 79ce91a66ad0b24aefb4691fdf607ba1e02ba1dd..e22f632ec7451e31226dbd3a12abb3f4ef39a1bb 100644 (file)
@@ -3,3 +3,4 @@ A quickie TODO list for lsb*:
 * Finish lsbinstall
 * Move dynamic linker symlinks from postinst into package itself. (?)
 * Only build lsb-* for LSB architectures in Debian.
+* Make lsb stuff available in a Python package.
index 00456634318e672a827fa57a31145c4ab148b778..022e33cb498629e5b0da51400c359687ae248216 100644 (file)
@@ -1,3 +1,15 @@
+lsb (3.1-16) unstable; urgency=low
+
+  * Improve documentation of killproc().  (Closes: #384814)
+  * Also improve documentation of pidofproc() in the same vein.
+  * Move lsb_release to /usr.  (Closes: #389380)
+  * Modify log_use_fancy_output() to only test once for a fancy TTY; patch
+    by Brendan O'Dea.  (Closes: #389497)
+  * Fix semantics of killproc() to behave properly when $sig is specified.
+    (Closes: #389403)
+
+ -- Chris Lawrence <lawrencc@debian.org>  Wed, 27 Sep 2006 18:10:12 -0500
+
 lsb (3.1-15) unstable; urgency=low
 
   * Fix assignment to $opt in pidofproc().  (Closes: #384540)
index b97ce11fbd122554f915c77f3136fa434b6ea163..0ca9871828bc778dc97072332517ef292c4133f7 100644 (file)
@@ -2,7 +2,8 @@ lsb-base for Debian
 -------------------
 
 The Debian lsb-base package provides a series of logging functions to
-permit simplified logging of init script actions.
+permit simplified logging of init script actions.  These functions are
+specific to Debian and (in some cases) other derived distributions.
 
   - log_daemon_msg "Starting/stopping long daemon name" "daemond"
 
@@ -25,7 +26,8 @@ permit simplified logging of init script actions.
     TTY) followed by newline.
 
     Unsucessful startup will cause the specified failure code to be
-    returned by this function.
+    returned by this function; unless trapped, this may end your init
+    script depending on whether or not set -e is used.
 
   - log_action_msg "Setting VARIABLE to VALUE"
 
@@ -63,6 +65,9 @@ permit simplified logging of init script actions.
 
     On color TTYs, the failure messages will be red.
 
+    Note that unlike log_end_msg(), this function does not return the
+    first argument as its exit code.
+
 A deprecated function, log_start_msg, is also provided for
 compatibility with a few older packages and a derived distribution.
 This may eventually disappear.
@@ -91,10 +96,13 @@ start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...]
   implement this functionality.
 
 killproc [-p pidfile] pathname [signal]
-  Stops "pathname" (using "pidfile", if specified, to find the process ID).
+  Stops "pathname" (using "pidfile", if specified, to find the process
+  ID).  This is implemented using start-stop-daemon as well.
 
 pidofproc [-p pidfile] pathname
-  Find the process ID of pathname.
+  Find the process ID of pathname.  If the pidfile is specified, we use the
+  first space-delimited word; otherwise, /bin/pidof is used from the
+  sysvinit package, if available.
 
 For full documentation, please refer to:
 
@@ -102,7 +110,10 @@ http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/in
 
 Note: Debian packages probably should use start-stop-daemon directly;
 however, these functions may be useful in porting init scripts from
-other distributions.
+other distributions.  Also, if you are developing software for wider
+use, you should not expect these functions to be implemented
+identically on other LSB-conforming distributions; the only guaranteed
+behaviors are those in the specification above.
 
 CUSTOMIZING LOGGING OUTPUT
 
@@ -119,4 +130,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>, Fri, 11 Aug 2006 23:38:28 -0500
+ -- Chris Lawrence <lawrencc@debian.org>, Sat, 26 Aug 2006 21:40:06 -0500
index 5e56e040ec0902e58df8573adaec65c5da6e9304..415f082dd910d68018bafc3092793db6a06ebf68 100644 (file)
@@ -1 +1 @@
-/bin
+/usr/bin
index aa3298d4e233ff07c344651c2adff915ab11129c..56aab8387df161fbdf3eb91fe76a1d49e48592ec 100755 (executable)
@@ -84,7 +84,7 @@ install: build
        #$(MAKE) install DESTDIR=$(CURDIR)/debian/lsb
        cp -p initdutils.py install_initd remove_initd lsbinstall debian/lsb-core/usr/lib/lsb
        cp -p init-functions debian/lsb-base/lib/lsb
-       cp -p lsb_release debian/lsb-release/bin
+       cp -p lsb_release debian/lsb-release/usr/bin
 
 # Build architecture-independent files here.
 binary-indep: build install
index 099e64e22d7b756f38f6f0260ebafa59a11ad46b..c4ddfc846f6b56478950194d8c994383c6b81316 100644 (file)
@@ -95,14 +95,13 @@ pidofproc () {
 
 # start-stop-daemon uses the same algorithm as "pidofproc" above.
 killproc () {
-    local pidfile sig status base i specified
+    local pidfile sig status base i
     pidfile=
-    specified=
 
     OPTIND=1
     while getopts p: opt ; do
         case "$opt" in
-            p)  pidfile="$OPTARG"; specified=1;;
+            p)  pidfile="$OPTARG";;
         esac
     done
     shift $(($OPTIND - 1))
@@ -114,9 +113,8 @@ killproc () {
 
     sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/')
     sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/')
-    sig=${sig:-TERM}
-    if [ "$specified" ]; then
-        /sbin/start-stop-daemon --stop --pidfile "$pidfile" --signal $sig --quiet --name "$base"
+    if [ -n "$sig" ]; then
+        /sbin/start-stop-daemon --stop --pidfile "$pidfile" --signal "$sig" --quiet --name "$base"
     else
         /sbin/start-stop-daemon --stop --pidfile "$pidfile" --retry 5 --quiet --oknodo --name "$base"
     fi
@@ -133,16 +131,17 @@ killproc () {
 log_use_fancy_output () {
     TPUT=/usr/bin/tput
     EXPR=/usr/bin/expr
-    if [ FANCYTTY = 0 ]; then
-        false
-    fi
-    if [ "x$TERM" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1; then
-        FANCYTTY=1
-        true
-    else
-        FANCYTTY=0
-        false
+    if [ -z $FANCYTTY ]; then
+        if [ "x$TERM" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1; then
+            FANCYTTY=1
+        else
+            FANCYTTY=0
+        fi
     fi
+    case "$FANCYTTY" in
+        1|Y|yes|true)   true;;
+        *)              false;;
+    esac
 }
 
 log_success_msg () {