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