/etc/init.d/laptop-mode is in laptop-mode-tools 1.60-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #! /bin/sh
#
# chkconfig: - 99 99
# description: Starts and stops "laptop-mode" - tweaks system behavior
# to extend battery life.
#
# 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
. /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
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
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.
log_action_begin_msg "Enabling laptop mode"
rm -f /var/run/laptop-mode-tools/*
touch /var/run/laptop-mode-tools/enabled
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
RESULT=`/usr/sbin/laptop_mode init stop`
log_action_end_msg $? "$RESULT"
;;
status)
echo "Laptop mode status:"
echo
/usr/sbin/laptop_mode status
;;
*)
echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2
exit 2
;;
esac
exit 0
|