Package: rng-tools Version: 2-unofficial-mt.10-2 Severity: minor Tags: patch
Hi, the attached patch changes the rng-tools init.d script(s) to use lsb logging functions. Regards, David
diff -ur ./rng-tools-2-unofficial-mt.10.orig/debian/control ./rng-tools-2-unofficial-mt.10/debian/control --- ./rng-tools-2-unofficial-mt.10.orig/debian/control 2006-08-28 00:14:05.000000000 +0200 +++ ./rng-tools-2-unofficial-mt.10/debian/control 2006-08-28 00:25:50.000000000 +0200 @@ -7,7 +7,7 @@ Package: rng-tools Architecture: any -Depends: ${shlibs:Depends}, makedev (>= 2.3.1-77) | udev (>= 0.053) +Depends: ${shlibs:Depends}, makedev (>= 2.3.1-77) | udev (>= 0.053), lsb-base (>= 3.0-10) Provides: intel-rng-tools Replaces: intel-rng-tools Conflicts: intel-rng-tools diff -ur ./rng-tools-2-unofficial-mt.10.orig/debian/rng-tools.init ./rng-tools-2-unofficial-mt.10/debian/rng-tools.init --- ./rng-tools-2-unofficial-mt.10.orig/debian/rng-tools.init 2006-08-28 00:14:05.000000000 +0200 +++ ./rng-tools-2-unofficial-mt.10/debian/rng-tools.init 2006-08-28 00:25:11.000000000 +0200 @@ -17,6 +17,7 @@ HRNGDEVICE=/dev/hwrng RNGDOPTIONS= [ -r /etc/default/rng-tools ] && . /etc/default/rng-tools +. /lib/lsb/init-functions test -f ${DAEMON} || exit 0 @@ -34,44 +35,39 @@ return 0 fi done - - echo "(Hardware RNG device inode not found)" - echo "$0: Cannot find a hardware RNG device to use." >&2 - exit 1 + return 1 } START="--start --quiet --pidfile ${PIDFILE} --startas ${DAEMON} --name ${NAME}" case "$1" in start) - echo -n "Starting $DESC: " - finddevice + log_daemon_msg "Starting $DESC" "$NAME" + if ! finddevice; then + log_end_msg 1 "no hardware RNG device found" + exit 1 + fi + START="${START} -- -r ${HRNGDEVICE} ${RNGDOPTIONS}" if start-stop-daemon ${START} >/dev/null 2>&1 ; then - echo "${NAME}." + log_end_msg 0 + elif start-stop-daemon --test ${START} >/dev/null 2>&1; then + log_end_msg 1 + exit 1 else - if start-stop-daemon --test ${START} >/dev/null 2>&1; then - echo "(failed)." - exit 1 - else - echo "${DAEMON} already running." - exit 0 - fi + log_end_msg 0 "already running." fi ;; stop) - echo -n "Stopping $DESC: " + log_daemon_msg "Stopping $DESC" "$NAME" if start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \ --startas ${DAEMON} --retry 10 --name ${NAME} \ >/dev/null 2>&1 ; then - echo "${NAME}." + log_end_msg 0 + elif start-stop-daemon --test ${START} >/dev/null 2>&1; then + log_end_msg 0 "not running" else - if start-stop-daemon --test ${START} >/dev/null 2>&1; then - echo "(not running)." - exit 0 - else - echo "(failed)." - exit 1 - fi + log_end_msg 1 + exit 1 fi ;; restart|force-reload) @@ -80,7 +76,7 @@ ;; *) echo "Usage: $0 {start|stop|restart|force-reload}" 1>&2 - exit 1 + exit 2 ;; esac