+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)
-------------------
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"
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"
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.
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:
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
"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
# 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))
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
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 () {