mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
Enable klogd on Linux < 3.5
On Linux >= 3.5, systemd takes care of logging kernel messages.
This commit is contained in:
parent
a5969634f4
commit
dd1770bf0b
@ -77,7 +77,7 @@
|
||||
./services/hardware/udev.nix
|
||||
./services/hardware/udisks.nix
|
||||
./services/hardware/upower.nix
|
||||
#./services/logging/klogd.nix
|
||||
./services/logging/klogd.nix
|
||||
./services/logging/logcheck.nix
|
||||
./services/logging/logrotate.nix
|
||||
./services/logging/logstash.nix
|
||||
|
@ -1,19 +1,42 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
###### implementation
|
||||
with pkgs.lib;
|
||||
|
||||
{
|
||||
###### interface
|
||||
|
||||
jobs.klogd =
|
||||
{ description = "Kernel log daemon";
|
||||
options = {
|
||||
|
||||
startOn = "started syslogd";
|
||||
|
||||
path = [ pkgs.sysklogd ];
|
||||
|
||||
exec =
|
||||
"klogd -c 1 -2 -n " +
|
||||
"-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map";
|
||||
services.klogd.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = versionOlder (getVersion config.boot.kernelPackages.kernel) "3.5";
|
||||
description = ''
|
||||
Whether to enable klogd, the kernel log message processing
|
||||
daemon. Since systemd handles logging of kernel messages on
|
||||
Linux 3.5 and later, this is only useful if you're running an
|
||||
older kernel.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf config.services.klogd.enable {
|
||||
|
||||
jobs.klogd =
|
||||
{ description = "Kernel Log Daemon";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
path = [ pkgs.sysklogd ];
|
||||
|
||||
exec =
|
||||
"klogd -c 1 -2 -n " +
|
||||
"-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user