2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2008-05-08 15:47:44 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2008-05-08 15:47:44 +02:00
|
|
|
{
|
2012-10-05 19:44:15 +02:00
|
|
|
###### interface
|
2008-05-08 15:47:44 +02:00
|
|
|
|
2012-10-05 19:44:15 +02:00
|
|
|
options = {
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2012-10-05 19:44:15 +02:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2012-10-05 19:44:15 +02:00
|
|
|
};
|
2011-11-25 17:32:54 +01:00
|
|
|
|
2012-10-05 19:44:15 +02:00
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf config.services.klogd.enable {
|
|
|
|
|
|
|
|
jobs.klogd =
|
|
|
|
{ description = "Kernel Log Daemon";
|
|
|
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
path = [ pkgs.sysklogd ];
|
|
|
|
|
2013-11-26 18:17:12 +01:00
|
|
|
unitConfig.ConditionVirtualization = "!systemd-nspawn";
|
|
|
|
|
2012-10-05 19:44:15 +02:00
|
|
|
exec =
|
|
|
|
"klogd -c 1 -2 -n " +
|
|
|
|
"-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2008-05-08 15:47:44 +02:00
|
|
|
}
|