Próximo: , Anterior: , Acima: Serviços   [Conteúdo][Índice]


11.10.35 Serviços Linux

Early OOM Service

Early OOM, also known as Earlyoom, is a minimalist out of memory (OOM) daemon that runs in user space and provides a more responsive and configurable alternative to the in-kernel OOM killer. It is useful to prevent the system from becoming unresponsive when it runs out of memory.

Variável: earlyoom-service-type

The service type for running earlyoom, the Early OOM daemon. Its value must be a earlyoom-configuration object, described below. The service can be instantiated in its default configuration with:

(service earlyoom-service-type)
Tipo de dados: earlyoom-configuration

This is the configuration record for the earlyoom-service-type.

earlyoom (default: earlyoom)

The Earlyoom package to use.

minimum-available-memory (default: 10)

The threshold for the minimum available memory, in percentages.

minimum-free-swap (default: 10)

The threshold for the minimum free swap memory, in percentages.

prefer-regexp (default: #f)

A regular expression (as a string) to match the names of the processes that should be preferably killed.

avoid-regexp (default: #f)

A regular expression (as a string) to match the names of the processes that should not be killed.

memory-report-interval (default: 0)

The interval in seconds at which a memory report is printed. It is disabled by default.

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

A boolean indicating whether the positive adjustments set in /proc/*/oom_score_adj should be ignored.

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

A boolean indicating whether debug messages should be printed. The logs are saved at /var/log/earlyoom.log.

send-notification-command (default: #f)

This can be used to provide a custom command used for sending notifications.

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.

Variável: 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:

(service fstrim-service-type)
Tipo de dados: 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 em 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).

Kernel Module Loader Service

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.

Variável: kernel-module-loader-service-type

The service type for loading loadable kernel modules at boot with modprobe. Its value must be a list of strings representing module names. For example loading the drivers provided by ddcci-driver-linux, in debugging mode by passing some module parameters, can be done as follow:

(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")))
Variável: 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.

Tipo de dados: 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.

Variável: rasdaemon-service-type

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

(service rasdaemon-service-type)

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

Tipo de dados: 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.

Zram Device Service

The Zram device service provides a compressed swap device in system memory. The Linux Kernel documentation has more information about zram devices.

Variável: zram-device-service-type

This service creates the zram block device, formats it as swap and enables it as a swap device. The service’s value is a zram-device-configuration record.

Tipo de dados: zram-device-configuration

This is the data type representing the configuration for the zram-device service.

size (default "1G")

This is the amount of space you wish to provide for the zram device. It accepts a string and can be a number of bytes or use a suffix, eg.: "512M" or 1024000.

compression-algorithm (default 'lzo)

This is the compression algorithm you wish to use. It is difficult to list all the possible compression options, but common ones supported by Guix’s Linux Libre Kernel include 'lzo, 'lz4 and 'zstd.

memory-limit (default 0)

This is the maximum amount of memory which the zram device can use. Setting it to ’0’ disables the limit. While it is generally expected that compression will be 2:1, it is possible that uncompressable data can be written to swap and this is a method to limit how much memory can be used. It accepts a string and can be a number of bytes or use a suffix, eg.: "2G".

priority (default #f)

This is the priority of the swap device created from the zram device. Veja Espaço de troca (swap) 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.


Próximo: Serviços Hurd, Anterior: Serviços Guix, Acima: Serviços   [Conteúdo][Índice]