Package: laptop-mode-tools
Version: 1.31-1
Severity: minor
Tags: patch
Hi,
the attached patch changes the laptop-mode-tools init.d script(s) to use lsb
logging functions.
Regards,
David
diff -ur ./laptop-mode-tools-1.31.orig/debian/control
./laptop-mode-tools-1.31/debian/control
--- ./laptop-mode-tools-1.31.orig/debian/control 2006-08-27
20:30:31.000000000 +0200
+++ ./laptop-mode-tools-1.31/debian/control 2006-08-27 20:52:11.000000000
+0200
@@ -7,6 +7,7 @@
Package: laptop-mode-tools
Architecture: all
+Depends: lsb-base (>= 3.0-10)
Recommends: acpid | apmd | pbbuttonsd | pmud, hdparm, sdparm
Conflicts: noflushd
Description: Scripts to spin down hard drive and save power
diff -ur ./laptop-mode-tools-1.31.orig/etc/init.d/laptop-mode
./laptop-mode-tools-1.31/etc/init.d/laptop-mode
--- ./laptop-mode-tools-1.31.orig/etc/init.d/laptop-mode 2006-02-06
11:33:38.000000000 +0100
+++ ./laptop-mode-tools-1.31/etc/init.d/laptop-mode 2006-08-27
20:51:13.000000000 +0200
@@ -8,43 +8,43 @@
test -f /usr/sbin/laptop_mode || exit 0
+. /lib/lsb/init-functions
+
# Enable laptop mode when the system is booted when running on battery.
case $1 in
start)
- echo -n "Enabling laptop mode: "
+ log_action_begin_msg "Enabling laptop mode"
touch /var/run/laptop-mode-enabled
/usr/sbin/laptop_mode auto init
- exit 0
+ log_action_end_msg 0
;;
restart|reload|force-reload)
set -e
- echo -n "Restarting laptop mode: "
+ log_action_begin_msg "Restarting laptop mode"
/usr/sbin/laptop_mode auto init force
- exit 0
+ log_action_end_msg 0
;;
stop)
rm -f /var/run/laptop-mode-enabled
- echo -n "Disabling laptop mode: "
+ log_action_begin_msg "Disabling laptop mode"
if ! ( /usr/sbin/laptop_mode stop init ) ; then
- echo " (failed)."
+ log_action_end_msg 1
exit 1
fi
- exit 0
;;
status)
echo "Laptop mode status:"
echo
/usr/sbin/laptop_mode status
- exit 0
;;
*)
- echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2
- exit 1
+ echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2
+ exit 2
;;
esac
-
+exit 0