Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 laptop-mode-tools (1.61-1ubuntu1) quantal; urgency=low
 .
   * Merge from Debian unstable.  Remaining changes:
     - debian/rules: Do not ship obsolete acpi/apm scripts.
Author: Bhavani Shankar <bhavi@ubuntu.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- laptop-mode-tools-1.61.orig/etc/init.d/laptop-mode
+++ laptop-mode-tools-1.61/etc/init.d/laptop-mode
@@ -6,63 +6,54 @@
 #
 # config:  /etc/laptop-mode/laptop-mode.conf
 
+### BEGIN INIT INFO
+# Provides:          laptop-mode
+# Should-Start:      $all
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Enable laptop-mode-tools power management functions
+# Description:       Enable laptop-mode-tools power management functions
+### END INIT INFO
+
+
 test -f /usr/sbin/laptop_mode || exit 0
 
-if [ -f /lib/lsb/init-functions ] ; then
-  . /lib/lsb/init-functions
-else
-  log_success_msg()
-  {
-    logger -t LAPTOP-MODE -p daemon.info -- $*
-    echo "$*"
-  }
-  log_failure_msg()
-  {
-    logger -t LAPTOP-MODE -p daemon.notice -- $*
-    echo "$*"
-  }
-fi
+. /lib/lsb/init-functions
 
 # Enable laptop mode when the system is booted when running on battery.
 
 case $1 in
   start)
+    log_action_begin_msg "Enabling laptop mode"
     mkdir -p /var/run/laptop-mode-tools
     touch /var/run/laptop-mode-tools/enabled
-    if RESULT=`/usr/sbin/laptop_mode auto` ; then
-      log_success_msg "$RESULT"
-    else
-      log_failure_msg "$RESULT"
-    fi
+    RESULT=`/usr/sbin/laptop_mode init auto`
+    log_action_end_msg $? "$RESULT"
     ;;
 
   restart|reload|force-reload)
     # Full restart: first stop laptop mode completely (to restore default mount options etc.)
+    log_action_begin_msg "Disabling laptop mode"
     mkdir -p /var/run/laptop-mode-tools
-    rm -f /var/run/laptop-mode-tools/enabled    
-    if RESULT=`/usr/sbin/laptop_mode stop` ; then
-      log_success_msg "$RESULT"
-    else
-      log_failure_msg "$RESULT"
-    fi
+    rm -f /var/run/laptop-mode-tools/enabled
+    RESULT=`/usr/sbin/laptop_mode init stop`
+    log_action_end_msg $? "$RESULT"
 
     # Now remove files containing stored status, re-enable, and start it up again.
-    rm -f /var/run/laptop-mode-tools/*
+    log_action_begin_msg "Enabling laptop mode"
+    rm -f /var/run/laptop-mode-tools/*
     touch /var/run/laptop-mode-tools/enabled
-    if RESULT=`/usr/sbin/laptop_mode auto force` ; then
-      log_success_msg "$RESULT"
-    else
-      log_failure_msg "$RESULT"
-    fi
+    RESULT=`/usr/sbin/laptop_mode init auto force`
+    log_action_end_msg $? "$RESULT"
     ;;
 
   stop)
+    log_action_begin_msg "Disabling laptop mode"
     rm -f /var/run/laptop-mode-tools/enabled
-    if RESULT=`/usr/sbin/laptop_mode stop` ; then
-      log_success_msg "$RESULT"
-    else
-      log_failure_msg "$RESULT"
-    fi
+    RESULT=`/usr/sbin/laptop_mode init stop`
+    log_action_end_msg $? "$RESULT"
     ;;
 
   status)
--- laptop-mode-tools-1.61.orig/etc/power/scripts.d/laptop-mode
+++ laptop-mode-tools-1.61/etc/power/scripts.d/laptop-mode
@@ -28,7 +28,7 @@ if [ -w /proc/sys/vm/laptop_mode ]; then
         $LMODE "stop"
         ;;
       resume)
-        /etc/init.d/laptop-mode restart
+        $LMODE "auto" "force"
         ;;        
     esac
 elif [ -x logger ]; then	
