3
0
Fork 0
forked from mirrors/nixpkgs

* Log the standard output/error of Upstart jobs to

/var/log/upstart/<jobname> rather than spamming the console with it.

svn path=/nixos/trunk/; revision=22093
This commit is contained in:
Eelco Dolstra 2010-06-01 19:44:23 +00:00
parent e450e4551f
commit 95a9c5dd77
8 changed files with 16 additions and 11 deletions

View file

@ -66,7 +66,7 @@ in
jobs.atd = jobs.atd =
{ description = "at daemon (atd)"; { description = "at daemon (atd)";
startOn = "startup"; startOn = "started udev";
preStart = preStart =
'' ''

View file

@ -44,7 +44,7 @@ in
services.xserver.displayManager.job = services.xserver.displayManager.job =
{ execCmd = { execCmd =
'' ''
${pkgs.xorg.xinit}/bin/xinit \ exec ${pkgs.xorg.xinit}/bin/xinit \
${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \ ${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \
-- ${dmcfg.xserverBin} ${dmcfg.xserverArgs} -- ${dmcfg.xserverBin} ${dmcfg.xserverArgs}
''; '';

View file

@ -94,7 +94,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.xserver.displayManager.job = 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; logsXsession = true;
}; };

View file

@ -101,7 +101,7 @@ in
{ SLIM_CFGFILE = slimConfig; { SLIM_CFGFILE = slimConfig;
SLIM_THEMESDIR = slimThemesDir; 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 # Allow null passwords so that the user can login as root on the

View file

@ -96,6 +96,7 @@ let
fi fi
mkdir -m 0755 -p /var/log mkdir -m 0755 -p /var/log
mkdir -m 0755 -p /var/log/upstart
touch /var/log/wtmp # must exist touch /var/log/wtmp # must exist
chmod 644 /var/log/wtmp chmod 644 /var/log/wtmp

View file

@ -95,6 +95,7 @@ mkdir -m 0755 -p /etc/nixos
# Miscellaneous boot time cleanup. # Miscellaneous boot time cleanup.
rm -rf /var/run rm -rf /var/run
rm -rf /var/lock rm -rf /var/lock
rm -rf /var/log/upstart
#echo -n "cleaning \`/tmp'..." #echo -n "cleaning \`/tmp'..."
#rm -rf --one-file-system /tmp/* #rm -rf --one-file-system /tmp/*

View file

@ -23,13 +23,12 @@ let
let let
jobText = jobText =
let log = "/var/log/upstart/${job.name}"; in
'' ''
# Upstart job `${job.name}'. This is a generated file. Do not edit. # Upstart job `${job.name}'. This is a generated file. Do not edit.
description "${job.description}" description "${job.description}"
console output
${if isList job.startOn then ${if isList job.startOn then
"start on ${concatStringsSep " or " job.startOn}" "start on ${concatStringsSep " or " job.startOn}"
else if job.startOn != "" then else if job.startOn != "" then
@ -44,6 +43,7 @@ let
${optionalString (job.preStart != "") '' ${optionalString (job.preStart != "") ''
pre-start script pre-start script
exec >> ${log} 2>&1
${job.preStart} ${job.preStart}
end script end script
''} ''}
@ -53,18 +53,20 @@ let
else if job.script != "" then else if job.script != "" then
'' ''
script script
exec >> ${log} 2>&1
${job.script} ${job.script}
end script end script
'' ''
else if job.exec != "" then else if job.exec != "" then
'' ''
exec ${job.exec} exec ${job.exec} >> ${log} 2>&1
'' ''
else "" else ""
} }
${optionalString (job.postStart != "") '' ${optionalString (job.postStart != "") ''
post-start script post-start script
exec >> ${log} 2>&1
${job.postStart} ${job.postStart}
end script end script
''} ''}
@ -74,12 +76,14 @@ let
${optionalString (job.preStop != "") '' ${optionalString (job.preStop != "") ''
pre-stop script pre-stop script
exec >> ${log} 2>&1
${job.preStop} ${job.preStop}
end script end script
''} ''}
${optionalString (job.postStop != "") '' ${optionalString (job.postStop != "") ''
post-stop script post-stop script
exec >> ${log} 2>&1
${job.postStop} ${job.postStop}
end script end script
''} ''}

View file

@ -123,7 +123,6 @@ in
theme=$(readlink ${themesUnpacked}/$tty) theme=$(readlink ${themesUnpacked}/$tty)
prevTheme=$(${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c getcfg | prevTheme=$(${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c getcfg |
sed 's/theme: *\(.*\)/\1/;t;d' || true) sed 's/theme: *\(.*\)/\1/;t;d' || true)
echo $tty $theme $prevTheme
if [ "$theme" != "$prevTheme" ]; then if [ "$theme" != "$prevTheme" ]; then
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setcfg -t $theme || true ${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setcfg -t $theme || true
fi fi