diff options
| author | Christopher Baines <mail@cbaines.net> | 2026-08-07 20:34:24 +0100 |
|---|---|---|
| committer | Christopher Baines <mail@cbaines.net> | 2026-08-21 16:42:58 +0100 |
| commit | dd12ee28474c2e4b128e8ab37cc4113a2088b604 (patch) | |
| tree | dccbb075f59028b545eb860c24be269bf4481b1a /doc | |
| parent | c3832cd497a8fcd87e84878c6ee3bbc10f42d0ca (diff) | |
gnu: services: pm: Add hd-idle.
* gnu/services/pm.scm: (hd-idle-disk, hd-idle-disk?, hd-idle-configuration, hd-idle-configuration?):
New prodedures.
(hd-idle-service-type): New variable.
* doc/guix.texi (Power Management Services): Document it.
Change-Id: I205b9a8de9aa8a15314d03962582aa3ae245a31e
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index f13c6ed970f..f19cb4f1ee6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -41289,6 +41289,101 @@ packages linux)} module | |||
| 41289 | @end table | 41289 | @end table |
| 41290 | @end deftp | 41290 | @end deftp |
| 41291 | 41291 | ||
| 41292 | @cindex hd-idle | ||
| 41293 | @cindex spinning down hard disks | ||
| 41294 | @subsubheading hd-idle | ||
| 41295 | |||
| 41296 | The @code{(gnu services pm)} module also provides a service definition | ||
| 41297 | for @uref{https://github.com/adelolmo/hd-idle, hd-idle}, a daemon that | ||
| 41298 | spins down hard disks after a period of inactivity. It is primarily | ||
| 41299 | useful for external @acronym{USB, Universal Serial Bus} disks, which | ||
| 41300 | usually do not support setting an idle timer with @command{hdparm}. | ||
| 41301 | |||
| 41302 | @defvar hd-idle-service-type | ||
| 41303 | The service type for hd-idle. Its value is an | ||
| 41304 | @code{hd-idle-configuration} record, as in this example, which spins | ||
| 41305 | down all disks after ten minutes of inactivity, except for | ||
| 41306 | @file{/dev/sda}, which is spun down after two minutes: | ||
| 41307 | |||
| 41308 | @lisp | ||
| 41309 | (service hd-idle-service-type | ||
| 41310 | (hd-idle-configuration | ||
| 41311 | (idle-time 600) | ||
| 41312 | (disks (list (hd-idle-disk | ||
| 41313 | (name "sda") | ||
| 41314 | (idle-time 120)))))) | ||
| 41315 | @end lisp | ||
| 41316 | @end defvar | ||
| 41317 | |||
| 41318 | @deftp {Data Type} hd-idle-configuration | ||
| 41319 | Data type representing the configuration of @code{hd-idle-service-type}. | ||
| 41320 | |||
| 41321 | @table @asis | ||
| 41322 | @item @code{idle-time} (default: @code{600}) | ||
| 41323 | Number of seconds a disk must be idle before it is spun down. A value | ||
| 41324 | of @code{0} disables spinning down. | ||
| 41325 | |||
| 41326 | To have hd-idle only work with the explicitly configured disks, set this | ||
| 41327 | to @code{0}. | ||
| 41328 | |||
| 41329 | @item @code{command-type} (default: @code{'scsi}) | ||
| 41330 | The command used to spin disks down, either @code{'scsi} or @code{'ata}. | ||
| 41331 | |||
| 41332 | @item @code{power-condition} (default: @code{0}) | ||
| 41333 | The power condition passed to the @acronym{SCSI, Small Computer System | ||
| 41334 | Interface} @code{START STOP UNIT} command, an integer between @code{0} | ||
| 41335 | and @code{15}. It is ignored when @code{command-type} is @code{'ata}. | ||
| 41336 | |||
| 41337 | @item @code{symlink-policy} (default: @code{0}) | ||
| 41338 | How to resolve disk names that are symbolic links. @code{0} resolves | ||
| 41339 | them once at startup, whereas with @code{1} symlinks are also resolved | ||
| 41340 | on runtime until success. | ||
| 41341 | |||
| 41342 | @item @code{log-file} (default: unset) | ||
| 41343 | A file name to which hd-idle logs disk spin-up and spin-down events, for | ||
| 41344 | instance @code{"/var/log/hd-idle.log"}. When left unset, no log file is | ||
| 41345 | written. | ||
| 41346 | |||
| 41347 | @item @code{ignore-spin-down-detection?} (default: @code{#f}) | ||
| 41348 | Whether to skip detection of disks that were spun down by some other | ||
| 41349 | means. | ||
| 41350 | |||
| 41351 | @item @code{debug?} (default: @code{#f}) | ||
| 41352 | Whether to log the disk statistics that hd-idle reads on each poll. | ||
| 41353 | |||
| 41354 | @item @code{disks} (default: @code{'()}) | ||
| 41355 | A list of @code{hd-idle-disk} records (see below) describing per-disk | ||
| 41356 | overrides. Disks that are not listed here are still managed, using the | ||
| 41357 | values above. | ||
| 41358 | |||
| 41359 | @item @code{hd-idle} (default: @code{hd-idle}) | ||
| 41360 | The hd-idle package to use. | ||
| 41361 | @end table | ||
| 41362 | @end deftp | ||
| 41363 | |||
| 41364 | @deftp {Data Type} hd-idle-disk | ||
| 41365 | Data type overriding the configuration above for a single disk. Fields | ||
| 41366 | left unset default to the corresponding top-level | ||
| 41367 | @code{hd-idle-configuration} value. | ||
| 41368 | |||
| 41369 | @table @asis | ||
| 41370 | @item @code{name} | ||
| 41371 | The device to configure, either a name under @file{/dev} such as | ||
| 41372 | @code{"sda"}, or an absolute file name such as | ||
| 41373 | @code{"/dev/disk/by-uuid/1234-5678"}. | ||
| 41374 | |||
| 41375 | @item @code{idle-time} (default: unset) | ||
| 41376 | Number of seconds this disk must be idle before it is spun down. | ||
| 41377 | |||
| 41378 | @item @code{command-type} (default: unset) | ||
| 41379 | The command used to spin this disk down, either @code{'scsi} or | ||
| 41380 | @code{'ata}. | ||
| 41381 | |||
| 41382 | @item @code{power-condition} (default: unset) | ||
| 41383 | The power condition to use for this disk. | ||
| 41384 | @end table | ||
| 41385 | @end deftp | ||
| 41386 | |||
| 41292 | The @code{(gnu services power)} module provides a service definition for | 41387 | The @code{(gnu services power)} module provides a service definition for |
| 41293 | @uref{http://www.apcupsd.org/, apcupsd}, a utility to interact with | 41388 | @uref{http://www.apcupsd.org/, apcupsd}, a utility to interact with |
| 41294 | @acronym{APC, APC by Schneider Electric or formerly American Power | 41389 | @acronym{APC, APC by Schneider Electric or formerly American Power |
