* Slight speedup. It's amazing how quickly shell scripts become
slow: calling basename in a loop somewhere has a noticable impact on performance. We really shouldn't use bash scripts. svn path=/nixos/trunk/; revision=33242
This commit is contained in:
parent
53580d514a
commit
b1fd71038e
@ -106,8 +106,7 @@ declare -A noRestartIfChanged=(@noRestartIfChanged@)
|
|||||||
# all jobs that don't have a "stop" goal.) We use the symlinks in
|
# all jobs that don't have a "stop" goal.) We use the symlinks in
|
||||||
# /var/run/upstart-jobs (created by each job's pre-start script) to
|
# /var/run/upstart-jobs (created by each job's pre-start script) to
|
||||||
# determine if a job has changed.
|
# determine if a job has changed.
|
||||||
for job in $(cd $jobsDir && ls *.conf); do
|
for job in @jobs@; do
|
||||||
job=$(basename $job .conf)
|
|
||||||
status=$(status "$job")
|
status=$(status "$job")
|
||||||
if ! [[ "$status" =~ start/ ]]; then continue; fi
|
if ! [[ "$status" =~ start/ ]]; then continue; fi
|
||||||
if [ "$(readlink -f "$jobsDir/$job.conf")" = "$(readlink -f "/var/run/upstart-jobs/$job")" ]; then continue; fi
|
if [ "$(readlink -f "$jobsDir/$job.conf")" = "$(readlink -f "/var/run/upstart-jobs/$job")" ]; then continue; fi
|
||||||
@ -128,8 +127,7 @@ done
|
|||||||
# differs from the previous instance of the same task; if it wasn't
|
# differs from the previous instance of the same task; if it wasn't
|
||||||
# previously run, don't run it. If it's a service, only start it if
|
# previously run, don't run it. If it's a service, only start it if
|
||||||
# it has a "start on" condition.
|
# it has a "start on" condition.
|
||||||
for job in $(cd $jobsDir && ls *.conf); do
|
for job in @jobs@; do
|
||||||
job=$(basename $job .conf)
|
|
||||||
status=$(status "$job")
|
status=$(status "$job")
|
||||||
if ! [[ "$status" =~ stop/ ]]; then continue; fi
|
if ! [[ "$status" =~ stop/ ]]; then continue; fi
|
||||||
|
|
||||||
|
@ -154,6 +154,8 @@ let
|
|||||||
initScriptBuilder = config.system.build.initScriptBuilder;
|
initScriptBuilder = config.system.build.initScriptBuilder;
|
||||||
activationScript = config.system.activationScripts.script;
|
activationScript = config.system.activationScripts.script;
|
||||||
|
|
||||||
|
jobs = map (j: j.name) (attrValues config.jobs);
|
||||||
|
|
||||||
# Pass the names of all Upstart tasks to the activation script.
|
# Pass the names of all Upstart tasks to the activation script.
|
||||||
tasks = attrValues (mapAttrs (n: v: if v.task then ["[${v.name}]=1"] else []) config.jobs);
|
tasks = attrValues (mapAttrs (n: v: if v.task then ["[${v.name}]=1"] else []) config.jobs);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user