SLEEPCTL(1) General Commands Manual SLEEPCTL(1)NAME
sleepctl - enable/disable sleepd
SYNOPSIS
sleeptcl [on|off|status]
DESCRIPTION
sleepctl allows temporarily disabling of the sleepd(8) daemon, by a regular user. This can be useful when you're in the middle of a long
download or compile, and don't want the system going to sleep in the middle.
"sleepctl off" makes sleepd not put the system to sleep even if it thinks it is idle. If this command is run more than once, the requests
stack up, and a like number of "sleepctl on" commands must be run to re-enable sleeping. This may be useful if multiple automated processes
or users use the command. Note that the system may still be put to sleep for other reasons, such as a failing battery.
"sleepctl on" re-enables sleeping. If sleeping is re-enabled and sleepd has seen no system activity for some time, and has been prevented
from putting the system to sleep, it may put the system to sleep immediatly.
"sleepctl status" outputs the current status of sleepd.
Note that if the system is forced to sleep by other means, sleepd will not remember what mode it was in when it wakes back up, and will
return to the default mode of putting the system to sleep after some amount of inactivity. This is by design, so you may easily and natu-
rally undo the effects of a "sleepctl off" without remembering to turn it back on.
This program communicates with sleepd by writing to the file /var/run/sleepd.ctl. As such, it needs read/write access to that file. It also
needs to run as whatever user sleepd runs as, so it can hup the daemon.
EXAMPLES
sleepctl off ; wget http://foo/huge.tgz ; sleepctl on
SEE ALSO sleepd(8)
http://kitenet.net/~joey/code/sleepd/
AUTHOR
Joey Hess <joey@kitenet.net>
SLEEPCTL(1)
Check Out this Related Man Page
SLEEPD(8) System Manager's Manual SLEEPD(8)NAME
sleepd - puts a laptop to sleep during inactivity or on low battery
SYNOPSIS
sleepd [-s command] [-d command] [-u n] [-U n] [-I] [-i n] [-E] [-e filename] [-a] [-l n] [-w] [-n] [-v] [-c n] [-b n] [-A] [-H] [-N
[device] [-r n] [-t n]]
DESCRIPTION
sleepd is a daemon to force laptops to go to sleep after some period of inactivity. This is useful if your laptop does not automatically go
to sleep when you aren't using it, and, like me, you often forget to shut it off. It is also capable of suspending a laptop when its bat-
tery gets very low.
sleepd can detect activity in several ways. The default is to poll both event devices and interrupts to detect when your laptop is in use
due to keyboard or mouse activity. It defaults to polling /dev/input/event*. You may specify a list of device files to poll instead, or
use options to enable other means of checking for activity (network activity, utmp, or load average). After a configurable amount of time
with no activity, sleepd runs a program to put the laptop to sleep.
OPTIONS -h, --help
Show summary of options.
-n, --nodaemon
Don't fork to background; run in forground.
-v, --verbose
Output status messages.
-u, --unused
Number of seconds the laptop can remain idle before being put to sleep. Defaults to 600 seconds (10 minutes). Set to 0 to disable
any sleeping due to idleness.
-U, --ac-unused
If set, controls the number of seconds the laptop can remain idle before being put to sleep when running on AC power. If not set,
the laptop will not sleep when it's on AC power.
-e, --event
Adds an event file to the list that is watched. Using this switch disables polling all files in /dev/input/event*.
-E, --no-events
This switch disables event device polling.
-l, --load
If set, a load average higher than this number will prevent the computer from sleeping If not set, the computer will ignore the load
average.
-w If set, sleepd will also check idletime based on utmp. This will prevent the system from sleeping while remote connections are
active. It uses the time limit from -u.
-i, --irq
Adds an irq to the list that is watched. Using this switch disables automatic detection of keyboard and mouse irqs unless -a is
specified as well.
-I, --no-irq
This switch disables interrupt polling.
-a, --auto
Automatically detect and watch mouse and keyboard irqs.
-s, --sleep-command
Command to run to put the laptop to sleep. Defaults to "apm -s" for systems with APM and "pm-suspend" for systems with ACPI.
-b, --battery
If this option is specified, the daemon will put the laptop to sleep if the percentage of battery charge drops below the specified
number and the system is off AC power. This is useful for some laptops which don't handle this themselves. It supports using APM,
ACPI, and HAL for querying battery status.
-d, --hibernate-command
A command to run instead of the regular sleep command when the battery is low. This can be useful if you want to make the system go
to sleep when it's not active, but suspend to disk if the battery is low. If not set, the sleep command is used.
-N, --netdev
Monitor a network interface for activity based on packet count. eth0 is the default. This option may be used more than once with
different network interfaces.
-t, --tx-min
Set a baseline transmit raffic rate in packets per second for network monitoring. Requires -N.
-r, --rx-min
Set a baseline receive traffic rate in packets per second for network monitoring. Requires -N.
-A, --and
Only go to sleep if all specified conditions are met. For example, only sleep if idle and if the battery is low.
-c, --check-period
Number of seconds between check on system status. Defaults to 10 seconds, which should be fine generally.
-H, --force-hal
Force HAL to be used instead of ACPI or other methods to query battery status.
SEE ALSO sleepctl(1)
http://kitenet.net/~joey/code/sleepd/
BUGS
Interrupt monitoring cannot always detect keyboard and mouse. If the keyboard or mouse interrupt is shared (as is common with usb
devices), other devices on the same interrupt can keep the system awake. Use event device polling instead.
AUTHOR
Joey Hess <joey@kitenet.net>
SLEEPD(8)