diff --git a/system/options.nix b/system/options.nix index baeb96853d3c..32e3a5b7b8e5 100644 --- a/system/options.nix +++ b/system/options.nix @@ -414,6 +414,9 @@ in (import ../system/unix-odbc-drivers.nix) + (import ../upstart-jobs/klogd.nix) + + # security (import ../system/sudo.nix) diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 1a3cf76740bb..69289bcf99d4 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -71,12 +71,6 @@ let jobs = map makeJob ([ - # Klogd. - (import ../upstart-jobs/klogd.nix { - inherit (pkgs) sysklogd writeText; - inherit config; - }) - # Makes LVM logical volumes available. (import ../upstart-jobs/lvm.nix { inherit modprobe; diff --git a/upstart-jobs/klogd.nix b/upstart-jobs/klogd.nix index 35207b339bda..59ab51fea928 100644 --- a/upstart-jobs/klogd.nix +++ b/upstart-jobs/klogd.nix @@ -1,26 +1,33 @@ -{sysklogd, writeText, config}: +{pkgs, config, ...}: +###### implementation let + inherit (pkgs.lib); - klogdCmd = "${sysklogd}/sbin/klogd -c 1 -2 -k $(dirname $(readlink -f /var/run/booted-system/kernel))/System.map"; + klogdCmd = "${pkgs.sysklogd}/sbin/klogd -c 1 -2 -k $(dirname $(readlink -f /var/run/booted-system/kernel))/System.map"; in { - name = "klogd"; - - job = '' - description "Kernel log daemon" - - start on syslogd - stop on shutdown - start script - # !!! this hangs for some reason (it blocks reading from - # /proc/kmsg). - #${klogdCmd} -o - end script + services = { + extraJobs = [{ + name = "klogd"; + + job = '' + description "Kernel log daemon" + + start on syslogd + stop on shutdown - respawn ${klogdCmd} -n - ''; + start script + # !!! this hangs for some reason (it blocks reading from + # /proc/kmsg). + #${klogdCmd} -o + end script + + respawn ${klogdCmd} -n + ''; + }]; + }; }