Convert "syslogd"

svn path=/nixos/branches/fix-style/; revision=14367
This commit is contained in:
Marc Weber 2009-03-06 12:25:57 +00:00
parent 8a8d387b22
commit 29cca0f34c
3 changed files with 46 additions and 32 deletions

View File

@ -383,19 +383,6 @@ in
services = {
syslogd = {
tty = mkOption {
default = 10;
description = "
The tty device on which syslogd will print important log
messages.
";
};
};
ttyBackgrounds = {
enable = mkOption {
@ -1775,6 +1762,7 @@ in
(import ../upstart-jobs/pulseaudio.nix)
(import ../upstart-jobs/kbd.nix)
(import ../upstart-jobs/gw6c.nix) # Gateway6
(import ../upstart-jobs/syslogd.nix)
(import ../upstart-jobs/nix.nix) # nix options and daemon
(import ../system/nixos-installer.nix)

View File

@ -71,12 +71,6 @@ let
jobs = map makeJob
([
# Syslogd.
(import ../upstart-jobs/syslogd.nix {
inherit (pkgs) sysklogd writeText;
inherit config;
})
# Klogd.
(import ../upstart-jobs/klogd.nix {
inherit (pkgs) sysklogd writeText;

View File

@ -1,8 +1,32 @@
{sysklogd, writeText, config}:
{pkgs, config, ...}:
###### interface
let
inherit (pkgs.lib) mkOption mkIf;
options = {
services = {
syslogd = {
tty = mkOption {
default = 10;
description = "
The tty device on which syslogd will print important log
messages.
";
};
};
};
};
in
###### implementation
let
syslogConf = writeText "syslog.conf" ''
syslogConf = pkgs.writeText "syslog.conf" ''
kern.warning;*.err;authpriv.none /dev/tty10
# Send emergency messages to all users.
@ -22,16 +46,24 @@ let
in
{
name = "syslogd";
job = ''
description "Syslog daemon"
start on udev
stop on shutdown
require = [
options
];
env TZ=${config.time.timeZone}
respawn ${sysklogd}/sbin/syslogd -n -f ${syslogConf}
'';
services = {
extraJobs = [{
name = "syslogd";
job = ''
description "Syslog daemon"
start on udev
stop on shutdown
env TZ=${config.time.timeZone}
respawn ${pkgs.sysklogd}/sbin/syslogd -n -f ${syslogConf}
'';
}];
};
}