Enable klogd on Linux < 3.5

On Linux >= 3.5, systemd takes care of logging kernel messages.
This commit is contained in:
Eelco Dolstra 2012-10-05 13:44:15 -04:00
parent a5969634f4
commit dd1770bf0b
2 changed files with 34 additions and 11 deletions

View file

@ -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

View file

@ -1,13 +1,34 @@
{ config, pkgs, ... }:
with pkgs.lib;
{
###### interface
options = {
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";
{ description = "Kernel Log Daemon";
startOn = "started syslogd";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.sysklogd ];
@ -16,4 +37,6 @@
"-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map";
};
};
}