summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog14
-rw-r--r--debian/control4
-rwxr-xr-xdebian/lsb-release.bugscript24
-rw-r--r--debian/lsb-release.dirs1
-rwxr-xr-xdebian/rules1
-rw-r--r--init-functions53
-rwxr-xr-xlsb_release2
-rw-r--r--test2
-rwxr-xr-xtest/minid.initd52
-rwxr-xr-xtest/minid.pl8
10 files changed, 129 insertions, 32 deletions
diff --git a/debian/changelog b/debian/changelog
index d24d361..c987317 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+lsb (3.2-16) unstable; urgency=low
+
+ * Add a bugscript to lsb-release to help figure out why people keep
+ getting very strange results.
+ * Lenny will be Debian 5.0, not Debian 4.1; fix accordingly.
+ * Improve output of lsb-specified logging functions; deal with
+ in-the-wild variations that omit messages.
+ * No longer use --retry in start-stop-daemon calls. (Closes: #451529)
+ * Fix behavior of killproc and pidofproc when no pidfile is passed in.
+ * Call pidof with -x to include scripts that may be daemonized.
+ * Change dependencies *cupsys* -> *cups*. (Closes: #490381)
+
+ -- Chris Lawrence <lawrencc@debian.org> Fri, 01 Aug 2008 16:39:43 -0500
+
lsb (3.2-15) unstable; urgency=low
* Add Basque [eu] translation. (Closes: #491005)
diff --git a/debian/control b/debian/control
index 8056786..6814526 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Homepage: http://www.linux-foundation.org/en/LSB
Package: lsb-core
Architecture: any
-Depends: lsb-release, ${glibc}, libz1, libncurses5, libpam0g, exim4 | mail-transport-agent, at, bc, binutils, bsdmainutils, bsdutils, cpio, cron, ed, file, libc6-dev | libc-dev, locales, lpr, lprng | cupsys-client, m4, mailx | mailutils, make, man-db, mawk | gawk, ncurses-term, passwd, patch, pax, procps, psmisc, rsync, alien (>= 8.36), ${python:Depends}, ${misc:Depends}, ${depends}, lsb-base
+Depends: lsb-release, ${glibc}, libz1, libncurses5, libpam0g, exim4 | mail-transport-agent, at, bc, binutils, bsdmainutils, bsdutils, cpio, cron, ed, file, libc6-dev | libc-dev, locales, lpr, lprng | cups-client, m4, mailx | mailutils, make, man-db, mawk | gawk, ncurses-term, passwd, patch, pax, procps, psmisc, rsync, alien (>= 8.36), ${python:Depends}, ${misc:Depends}, ${depends}, lsb-base
Provides: lsb-core-noarch, ${provides}
Conflicts: python (>= 2.6), lsb (<< 2.0-2)
Replaces: lsb (<< 2.0-2)
@@ -164,7 +164,7 @@ Description: Linux Standard Base 3.2 Multimedia package
Package: lsb-printing
Architecture: any
-Depends: lsb-core (>= 3.2), libcupsys2, libcupsimage2, foomatic-filters, ghostscript | gs
+Depends: lsb-core (>= 3.2), libcups2, libcupsimage2, foomatic-filters, ghostscript | gs
Provides: lsb-printing-noarch, ${provides}
Description: Linux Standard Base 3.2 Printing package
The Linux Standard Base (http://www.linuxbase.org/) is a standard
diff --git a/debian/lsb-release.bugscript b/debian/lsb-release.bugscript
new file mode 100755
index 0000000..151361b
--- /dev/null
+++ b/debian/lsb-release.bugscript
@@ -0,0 +1,24 @@
+#!/bin/sh
+echo 'lsb_release output' >& 3
+echo '-*- -*- -*- -*- -*-'>&3
+lsb_release -a >& 3
+echo '-*- -*- -*- -*- -*-'>&3
+echo ' Apt policy' >&3
+echo '-*- -*- -*- -*- -*-'>&3
+apt-cache policy >&3
+echo '-*- -*- -*- -*- -*-'>&3
+echo ' sources.list' >&3
+echo '-*- -*- -*- -*- -*-'>&3
+if [ -f /etc/apt/sources.list ]; then
+ cat /etc/apt/sources.list | grep -v '^\s*#' | grep -v '^\s*$' >&3
+else
+ echo '- none' >&3
+fi
+echo '-*- -*- -*- -*- -*-'>&3
+echo ' /etc/lsb_release' >&3
+echo '-*- -*- -*- -*- -*-'>&3
+if [ -f /etc/lsb_release ]; then
+ cat /etc/lsb_release >&3
+else
+ echo '- none' >&3
+fi
diff --git a/debian/lsb-release.dirs b/debian/lsb-release.dirs
index e772481..2e451f5 100644
--- a/debian/lsb-release.dirs
+++ b/debian/lsb-release.dirs
@@ -1 +1,2 @@
usr/bin
+usr/share/bug
diff --git a/debian/rules b/debian/rules
index 0f4c3a5..e21fb84 100755
--- a/debian/rules
+++ b/debian/rules
@@ -84,6 +84,7 @@ install: build
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/usr/bin
+ cp -p debian/lsb-release.bugscript debian/lsb-release/usr/share/bug/lsb-release
# Build architecture-independent files here.
binary-indep: build install
diff --git a/init-functions b/init-functions
index 0d6cbb5..724a06f 100644
--- a/init-functions
+++ b/init-functions
@@ -71,11 +71,7 @@ pidofproc () {
done
shift $(($OPTIND - 1))
- if [ -z "${pidfile:-}" ]; then
- pidfile=/var/run/${1##*/}.pid
- fi
-
- if [ -f "$pidfile" ]; then
+ if [ -n "${pidfile:-}" -a -e "$pidfile" ]; then
read pid < "$pidfile"
if [ -n "${pid:-}" ]; then
if $(kill -0 "${pid:-}" 2> /dev/null); then
@@ -91,7 +87,7 @@ pidofproc () {
fi
if [ -x /bin/pidof -a ! "$specified" ]; then
status="0"
- /bin/pidof -o %PPID $1 || status="$?"
+ /bin/pidof -o %PPID -x $1 || status="$?"
if [ "$status" = 1 ]; then
return 3 # program is not running
fi
@@ -117,8 +113,9 @@ killproc () {
base=${1##*/}
if [ ! $pidfile ]; then
- pidfile=/var/run/$base.pid
name_param="--name $base"
+ else
+ name_param="--pidfile $pidfile"
fi
sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/')
@@ -129,12 +126,12 @@ killproc () {
status=0
if [ ! "$is_term_sig" = yes ]; then
if [ -n "$sig" ]; then
- /sbin/start-stop-daemon --stop --signal "$sig" --pidfile "$pidfile" --quiet $name_param || status="$?"
+ /sbin/start-stop-daemon --stop --signal "$sig" --quiet $name_param || status="$?"
else
- /sbin/start-stop-daemon --stop --pidfile "$pidfile" --quiet $name_param || status="$?"
+ /sbin/start-stop-daemon --stop --quiet $name_param || status="$?"
fi
else
- /sbin/start-stop-daemon --stop --pidfile "$pidfile" --retry 5 --quiet --oknodo $name_param || status="$?"
+ /sbin/start-stop-daemon --stop --quiet --oknodo $name_param || status="$?"
fi
if [ "$status" = 1 ]; then
if [ -n "$sig" ]; then
@@ -143,8 +140,8 @@ killproc () {
return 3 # program is not running
fi
- if [ "$status" = 0 -a "$is_term_sig" = yes ]; then
- pidofproc -p $pidfile "$1" >/dev/null || rm -f "$pidfile"
+ if [ "$status" = 0 -a "$is_term_sig" = yes -a "$pidfile" ]; then
+ pidofproc -p "$pidfile" "$1" >/dev/null || rm -f "$pidfile"
fi
return 0
}
@@ -171,10 +168,10 @@ status_of_proc () {
status="0"
pidofproc $pidfile $daemon >/dev/null || status="$?"
if [ "$status" = 0 ]; then
- log_success_msg "$name is running."
+ log_success_msg "$name is running"
return 0
else
- log_failure_msg "$name is not running."
+ log_failure_msg "$name is not running"
return $status
fi
}
@@ -194,27 +191,24 @@ log_use_fancy_output () {
}
log_success_msg () {
- echo "$@"
+ if [ -n "${1:-}" ]; then
+ log_begin_msg $@
+ fi
+ log_end_msg 0
}
log_failure_msg () {
- if log_use_fancy_output; then
- RED=`$TPUT setaf 1`
- NORMAL=`$TPUT op`
- /bin/echo -e "${RED}*${NORMAL} $@"
- else
- echo "$@"
+ if [ -n "${1:-}" ]; then
+ log_begin_msg $@
fi
+ log_end_msg 1
}
log_warning_msg () {
- if log_use_fancy_output; then
- YELLOW=`$TPUT setaf 3`
- NORMAL=`$TPUT op`
- /bin/echo -e "${YELLOW}*${NORMAL} $@"
- else
- echo "$@"
+ if [ -n "${1:-}" ]; then
+ log_begin_msg $@
fi
+ log_end_msg -1
}
#
@@ -302,15 +296,20 @@ log_end_msg () {
# and if /usr is already mounted
if log_use_fancy_output; then
RED=`$TPUT setaf 1`
+ YELLOW=`$TPUT setaf 3`
NORMAL=`$TPUT op`
if [ $1 -eq 0 ]; then
echo "."
+ elif [ $1 -eq -1 ]; then
+ /bin/echo -e " ${YELLOW}(warning).${NORMAL}"
else
/bin/echo -e " ${RED}failed!${NORMAL}"
fi
else
if [ $1 -eq 0 ]; then
echo "."
+ elif [ $1 -eq -1 ]; then
+ echo -e " (warning)."
else
echo " failed!"
fi
diff --git a/lsb_release b/lsb_release
index 69f72db..3f6c7f8 100755
--- a/lsb_release
+++ b/lsb_release
@@ -36,7 +36,7 @@ RELEASE_CODENAME_LOOKUP = {
'3.0' : 'woody',
'3.1' : 'sarge',
'4.0' : 'etch',
- '4.1' : 'lenny',
+ '5.0' : 'lenny',
}
TESTING_CODENAME = 'lenny'
diff --git a/test b/test
deleted file mode 100644
index 8255579..0000000
--- a/test
+++ /dev/null
@@ -1,2 +0,0 @@
-. init-functions
-start_daemon -p /var/run/dirmngr.pid /usr/bin/dirmngr --daemon --sh
diff --git a/test/minid.initd b/test/minid.initd
new file mode 100755
index 0000000..2302015
--- /dev/null
+++ b/test/minid.initd
@@ -0,0 +1,52 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: svnd
+# Required-Start: $syslog $remote_fs
+# Should-Start: $time ypbind sendmail
+# Required-Stop: $syslog $remote_fs
+# Should-Stop: $time ypbind sendmail
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: The daemon
+# Description: a cool daemon
+### END INIT INFO
+# chkconfig: 345 99 00
+# description: a cool daemon
+
+
+DAEMON="/tmp/minid.pl"
+
+PARA=" "
+. /lib/lsb/init-functions
+
+case "$1" in
+ start)
+ echo -n "Starting $DAEMON "
+ start_daemon $DAEMON $PARA
+ RETVAL=$?
+ ;;
+ stop)
+ echo -n "Shutting down $DAEMON "
+ killproc $DAEMON -TERM
+ RETVAL=$?
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ echo -n "Checking for service $DAEMON "
+ pidofproc $DAEMON 2>&1 >/dev/null
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+
+if [ "x$RETVAL" = "x0" ] ; then
+ log_success_msg
+ else
+ log_failure_msg
+fi
diff --git a/test/minid.pl b/test/minid.pl
new file mode 100755
index 0000000..9bc81f2
--- /dev/null
+++ b/test/minid.pl
@@ -0,0 +1,8 @@
+#!/usr/bin/perl -w
+# detach from tty
+main:
+$pid = fork;
+exit if $pid;
+die "fork: $!" unless defined $pid;
+print "continue in child";
+sleep(4000);