From 95a9c5dd771e709f6e1fefc681ad4eb6a3bd593a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Jun 2010 19:44:23 +0000 Subject: [PATCH] * Log the standard output/error of Upstart jobs to /var/log/upstart/ rather than spamming the console with it. svn path=/nixos/trunk/; revision=22093 --- modules/services/scheduling/atd.nix | 2 +- modules/services/x11/display-managers/auto.nix | 2 +- modules/services/x11/display-managers/kdm.nix | 8 ++++---- modules/services/x11/display-managers/slim.nix | 2 +- modules/system/activation/activation-script.nix | 1 + modules/system/boot/stage-2-init.sh | 1 + modules/system/upstart/upstart.nix | 10 +++++++--- modules/tasks/tty-backgrounds.nix | 1 - 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/modules/services/scheduling/atd.nix b/modules/services/scheduling/atd.nix index 19fda42928ab..9538a332f7c0 100644 --- a/modules/services/scheduling/atd.nix +++ b/modules/services/scheduling/atd.nix @@ -66,7 +66,7 @@ in jobs.atd = { description = "at daemon (atd)"; - startOn = "startup"; + startOn = "started udev"; preStart = '' diff --git a/modules/services/x11/display-managers/auto.nix b/modules/services/x11/display-managers/auto.nix index 8805fbfd3833..507d24cd3ce9 100644 --- a/modules/services/x11/display-managers/auto.nix +++ b/modules/services/x11/display-managers/auto.nix @@ -44,7 +44,7 @@ in services.xserver.displayManager.job = { execCmd = '' - ${pkgs.xorg.xinit}/bin/xinit \ + exec ${pkgs.xorg.xinit}/bin/xinit \ ${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \ -- ${dmcfg.xserverBin} ${dmcfg.xserverArgs} ''; diff --git a/modules/services/x11/display-managers/kdm.nix b/modules/services/x11/display-managers/kdm.nix index 438846d30439..15553ba386b5 100644 --- a/modules/services/x11/display-managers/kdm.nix +++ b/modules/services/x11/display-managers/kdm.nix @@ -71,9 +71,9 @@ in enableXDMCP = mkOption { default = false; - description = '' - Whether to enable XDMCP, which allows remote logins. - ''; + description = '' + Whether to enable XDMCP, which allows remote logins. + ''; }; extraConfig = mkOption { @@ -94,7 +94,7 @@ in config = mkIf cfg.enable { services.xserver.displayManager.job = - { execCmd = "PATH=${pkgs.grub}/sbin:$PATH ${kdebase_workspace}/bin/kdm -config ${kdmrc}"; + { execCmd = "PATH=${pkgs.grub}/sbin:$PATH exec ${kdebase_workspace}/bin/kdm -config ${kdmrc} -nodaemon"; logsXsession = true; }; diff --git a/modules/services/x11/display-managers/slim.nix b/modules/services/x11/display-managers/slim.nix index ad767e199a15..cdb4dc785e25 100644 --- a/modules/services/x11/display-managers/slim.nix +++ b/modules/services/x11/display-managers/slim.nix @@ -101,7 +101,7 @@ in { SLIM_CFGFILE = slimConfig; SLIM_THEMESDIR = slimThemesDir; }; - execCmd = "${pkgs.slim}/bin/slim"; + execCmd = "exec ${pkgs.slim}/bin/slim"; }; # Allow null passwords so that the user can login as root on the diff --git a/modules/system/activation/activation-script.nix b/modules/system/activation/activation-script.nix index 744a35f54f4b..9a3a73e66d97 100644 --- a/modules/system/activation/activation-script.nix +++ b/modules/system/activation/activation-script.nix @@ -96,6 +96,7 @@ let fi mkdir -m 0755 -p /var/log + mkdir -m 0755 -p /var/log/upstart touch /var/log/wtmp # must exist chmod 644 /var/log/wtmp diff --git a/modules/system/boot/stage-2-init.sh b/modules/system/boot/stage-2-init.sh index 609bf0a95a4d..de9b136d02a3 100644 --- a/modules/system/boot/stage-2-init.sh +++ b/modules/system/boot/stage-2-init.sh @@ -95,6 +95,7 @@ mkdir -m 0755 -p /etc/nixos # Miscellaneous boot time cleanup. rm -rf /var/run rm -rf /var/lock +rm -rf /var/log/upstart #echo -n "cleaning \`/tmp'..." #rm -rf --one-file-system /tmp/* diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix index 74095d093ca8..e0c0f0bb99f1 100644 --- a/modules/system/upstart/upstart.nix +++ b/modules/system/upstart/upstart.nix @@ -23,13 +23,12 @@ let let jobText = + let log = "/var/log/upstart/${job.name}"; in '' # Upstart job `${job.name}'. This is a generated file. Do not edit. description "${job.description}" - console output - ${if isList job.startOn then "start on ${concatStringsSep " or " job.startOn}" else if job.startOn != "" then @@ -44,6 +43,7 @@ let ${optionalString (job.preStart != "") '' pre-start script + exec >> ${log} 2>&1 ${job.preStart} end script ''} @@ -53,18 +53,20 @@ let else if job.script != "" then '' script + exec >> ${log} 2>&1 ${job.script} end script '' else if job.exec != "" then '' - exec ${job.exec} + exec ${job.exec} >> ${log} 2>&1 '' else "" } ${optionalString (job.postStart != "") '' post-start script + exec >> ${log} 2>&1 ${job.postStart} end script ''} @@ -74,12 +76,14 @@ let ${optionalString (job.preStop != "") '' pre-stop script + exec >> ${log} 2>&1 ${job.preStop} end script ''} ${optionalString (job.postStop != "") '' post-stop script + exec >> ${log} 2>&1 ${job.postStop} end script ''} diff --git a/modules/tasks/tty-backgrounds.nix b/modules/tasks/tty-backgrounds.nix index 8ba46e1b6b34..b273dc8e599f 100644 --- a/modules/tasks/tty-backgrounds.nix +++ b/modules/tasks/tty-backgrounds.nix @@ -123,7 +123,6 @@ in theme=$(readlink ${themesUnpacked}/$tty) prevTheme=$(${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c getcfg | sed 's/theme: *\(.*\)/\1/;t;d' || true) - echo $tty $theme $prevTheme if [ "$theme" != "$prevTheme" ]; then ${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setcfg -t $theme || true fi