Next: , Previous: , Up: Servicios   [Contents][Index]


11.10.35 Servicios de Linux

Servicio Early OOM

Early OOM, también conocido como Earlyoom, es un daemon minimalista de gestión del llenado de la memoria49 que se ejecuta en espacio de usuaria y proporciona una alternativa al gestor del propio núcleo con una respuesta más inmediata y más configurable. Es útil para prevenir que el sistema no responda cuando se queda sin memoria.

Variable: earlyoom-service-type

Tipo de servicio para el servicio earlyoom, el daemon Early OOM. Su valor debe ser un objeto earlyoom-configuration, descrito a continuación. El servicio se puede instanciar con su configuración predeterminada de esta manera:

Tipo de datos: earlyoom-configuration

Esta es el registro de configuración para el servicio earlyoom-service-type.

earlyoom (predeterminado: earlyoom)

El paquete Earlyoom usado.

minimum-available-memory (predeterminado: 10)

El límite inferior de memoria disponible, en porcentaje.

minimum-free-swap (predeterminado: 10)

El límite inferior de memoria de intercambio libre, en porcentaje.

prefer-regexp (predeterminado: #f)

Una expresión regular (como cadena) que corresponda con los nombres de los procesos que preferiblemente deban pararse.

avoid-regexp (predeterminado: #f)

Una expresión regular (como cadena) que corresponda con los nombres de los procesos que no deban pararse.

memory-report-interval (predeterminado: 0)

Intervalo en segundos con el cual se imprime el informe de memoria. No está activo de manera predeterminada.

ignore-positive-oom-score-adj? (predeterminado: #f)

Valor booleano que indica si se deben ignoran los ajustes positivos realizados en /proc/*/oom_score_adj.

show-debug-messages? (predeterminado: #f)

Valor booleano que indica si los mensajes de depuración deben imprimirse. Los registros se almacenan en /var/log/earlyoom.log.

send-notification-command (predeterminada: #f)

Puede usarse para proporcionar una orden personalizada para el envío de notificaciones.

fstrim Service

The command fstrim can be used to discard (or trim) unused blocks on a mounted file system.

Aviso: Running fstrim frequently, or even using mount -o discard, might negatively affect the lifetime of poor-quality SSD devices. For most desktop and server systems a sufficient trimming frequency is once a week. Note that not all devices support a queued trim, so each trim command incurs a performance penalty on whatever else might be trying to use the disk at the time.

Variable: fstrim-service-type

Type for a service that periodically runs fstrim, whose value must be an <fstrim-configuration> object. The service can be instantiated in its default configuration with:

Data Type: fstrim-configuration

Available fstrim-configuration fields are:

package (default: util-linux) (type: file-like)

The package providing the fstrim command.

schedule (default: "0 0 * * 0") (type: mcron-time)

Schedule for launching fstrim. This can be a procedure, a list or a string. For additional information, see Job specification in the mcron manual. By default this is set to run weekly on Sunday at 00:00.

listed-in (default: '("/etc/fstab" "/proc/self/mountinfo")) (type: maybe-list-of-strings)

List of files in fstab or kernel mountinfo format. All missing or empty files are silently ignored. The evaluation of the list stops after the first non-empty file. File systems with X-fstrim.notrim mount option in fstab are skipped.

verbose? (default: #t) (type: boolean)

Verbose execution.

quiet-unsupported? (default: #t) (type: boolean)

Suppress error messages if trim operation (ioctl) is unsupported.

extra-arguments (type: maybe-list-of-strings)

Extra options to append to fstrim (run ‘man fstrim’ for more information).

Servicio de carga de módulos del núcleo

The kernel module loader service allows one to load loadable kernel modules at boot. This is especially useful for modules that don’t autoload and need to be manually loaded, as is the case with ddcci.

Variable: kernel-module-loader-service-type

Tipo de servicio para la carga de módulos del núcleo durante el arranque con modprobe. Su valor debe ser una lista de cadenas que representan nombres de módulo. Por ejemplo, la carga de los controladores proporcionados por ddcci-driver-linux en modo de depuración proporcionando algunos parámetros para el módulo puede realizarse de la siguiente manera:

(use-modules (gnu) (gnu services))
(use-package-modules linux)
(use-service-modules linux)

(define ddcci-config
  (plain-file "ddcci.conf"
              "options ddcci dyndbg delay=120"))

(operating-system
  ...
  (services (cons* (service kernel-module-loader-service-type
                            '("ddcci" "ddcci_backlight"))
                   (simple-service 'ddcci-config etc-service-type
                                   (list `("modprobe.d/ddcci.conf"
                                           ,ddcci-config)))
                   %base-services))
  (kernel-loadable-modules (list ddcci-driver-linux)))

Cachefilesd Service

The Cachefilesd service starts a daemon that caches network file system data locally. It is especially useful for NFS and AFS shares, where it reduces latencies for repeated access when reading files.

The daemon can be configured as follows:

(service cachefilesd-service-type
         (cachefilesd-configuration
           (cache-directory "/var/cache/fscache")))
Variable: cachefilesd-service-type

The service type for starting cachefilesd. The value for this service type is a cachefilesd-configuration, whose only required field is cache-directory.

Data Type: cachefilesd-configuration

Available cachefilesd-configuration fields are:

cachefilesd (default: cachefilesd) (type: file-like)

The cachefilesd package to use.

debug-output? (default: #f) (type: boolean)

Print debugging output to stderr.

use-syslog? (default: #t) (type: boolean)

Log to syslog facility instead of stdout.

scan? (default: #t) (type: boolean)

Scan for cachable objects.

cache-directory (type: maybe-string)

Location of the cache directory.

cache-name (default: "CacheFiles") (type: maybe-string)

Name of cache (keep unique).

security-context (type: maybe-string)

SELinux security context.

pause-culling-for-block-percentage (default: 7) (type: maybe-non-negative-integer)

Pause culling when available blocks exceed this percentage.

pause-culling-for-file-percentage (default: 7) (type: maybe-non-negative-integer)

Pause culling when available files exceed this percentage.

resume-culling-for-block-percentage (default: 5) (type: maybe-non-negative-integer)

Start culling when available blocks drop below this percentage.

resume-culling-for-file-percentage (default: 5) (type: maybe-non-negative-integer)

Start culling when available files drop below this percentage.

pause-caching-for-block-percentage (default: 1) (type: maybe-non-negative-integer)

Pause further allocations when available blocks drop below this percentage.

pause-caching-for-file-percentage (default: 1) (type: maybe-non-negative-integer)

Pause further allocations when available files drop below this percentage.

log2-table-size (default: 12) (type: maybe-non-negative-integer)

Size of tables holding cullable objects in logarithm of base 2.

cull? (default: #t) (type: boolean)

Create free space by culling (consumes system load).

trace-function-entry-in-kernel-module? (default: #f) (type: boolean)

Trace function entry in the kernel module (for debugging).

trace-function-exit-in-kernel-module? (default: #f) (type: boolean)

Trace function exit in the kernel module (for debugging).

trace-internal-checkpoints-in-kernel-module? (default: #f) (type: boolean)

Trace internal checkpoints in the kernel module (for debugging).

Rasdaemon Service

The Rasdaemon service provides a daemon which monitors platform RAS (Reliability, Availability, and Serviceability) reports from Linux kernel trace events, logging them to syslogd.

Reliability, Availability and Serviceability is a concept used on servers meant to measure their robustness.

Relability is the probability that a system will produce correct outputs:

Availability is the probability that a system is operational at a given time:

Serviceability is the simplicity and speed with which a system can be repaired or maintained:

Among the monitoring measures, the most usual ones include:

By monitoring the number of occurrences of error detections, it is possible to identify if the probability of hardware errors is increasing, and, on such case, do a preventive maintenance to replace a degraded component while those errors are correctable.

For detailed information about the types of error events gathered and how to make sense of them, see the kernel administrator’s guide at https://www.kernel.org/doc/html/latest/admin-guide/ras.html.

Variable: rasdaemon-service-type

Service type for the rasdaemon service. It accepts a rasdaemon-configuration object. Instantiating like

will load with a default configuration, which monitors all events and logs to syslogd.

Data Type: rasdaemon-configuration

The data type representing the configuration of rasdaemon.

record? (default: #f)

A boolean indicating whether to record the events in an SQLite database. This provides a more structured access to the information contained in the log file. The database location is hard-coded to /var/lib/rasdaemon/ras-mc_event.db.

Servicio de dispositivo Zram

El servicio de dispositivo Zram proporciona un dispositivo comprimido de intercambio en la memoria del sistema. La documentación del núcleo Linux contiene más información sobre dispositivos zram.

Variable: zram-device-service-type

Este servicio crea el dispositivo de bloques zram, le proporciona el formato de la memoria de intercambio y lo activa. El valor del servicio es un registro zram-device-configuration.

Tipo de datos: zram-device-configuration

Este tipo de datos representa la configuración del servicio zram-device.

size (predeterminado: "1G")

Es la cantidad de espacio que desea proporcionar al dispositivo zram. Acepta una cadena y puede ser el número de bytes o usar un sufijo, como por ejemplo "512M" o 1024000.

compression-algorithm (predeterminado: 'lzo)

Algoritmo de compresión que desea usar. Es difícil enumerar todas las opciones de compresión posibles, pero las más habituales entre las implementadas por el núcleo Linux Libre usado por Guix incluyen 'lzo, 'lz4 y 'zstd.

memory-limit (predeterminado: 0)

Cantidad máxima de memoria que el dispositivo zram puede usar. Proporcionar el valor ’0’ desactiva el límite. Mientras que generalmente se espera que la compresión tenga una relación con los datos sin comprimir de 2:1, es posible que se escriban datos en la memoria de intercambio que no se pueden comprimir más, y esta es una forma de limitar cuanta memoria puede usarse. Acepta una cadena y puede ser un número de bytes o un usar sufijo, por ejemplo "2G".

priority (default #f)

This is the priority of the swap device created from the zram device. See Swap Space for a description of swap priorities. You might want to set a specific priority for the zram device, otherwise it could end up not being used much for the reasons described there.


Footnotes

(49)

NdT: Del inglés Out Of Memory.


Next: Servicios de Hurd, Previous: Servicios de Guix, Up: Servicios   [Contents][Index]