* Fix indentation.

svn path=/nixos/branches/upstart-0.6/; revision=18186
This commit is contained in:
Eelco Dolstra 2009-11-06 09:26:36 +00:00
parent 194a24bcf1
commit 5fc4590ce5

View File

@ -73,10 +73,12 @@ let
echo "$jobText" > $out/etc/event.d/${job.name} echo "$jobText" > $out/etc/event.d/${job.name}
''; '';
jobs = jobs =
[pkgs.upstart] # for the built-in logd job [pkgs.upstart] # for the built-in logd job
++ map (job: job.upstartPkg) (attrValues config.jobs); ++ map (job: job.upstartPkg) (attrValues config.jobs);
# Create an etc/event.d directory containing symlinks to the # Create an etc/event.d directory containing symlinks to the
# specified list of Upstart job files. # specified list of Upstart job files.
jobsDir = pkgs.runCommand "upstart-jobs" {inherit jobs;} jobsDir = pkgs.runCommand "upstart-jobs" {inherit jobs;}
@ -93,132 +95,133 @@ let
done done
''; # */ ''; # */
# !! remove extra indentations.
jobOptions = { jobOptions = {
name = mkOption { name = mkOption {
# !!! The type should ensure that this could be a filename. # !!! The type should ensure that this could be a filename.
type = types.string; type = types.string;
example = "sshd"; example = "sshd";
description = '' description = ''
Name of the Upstart job. Name of the Upstart job.
''; '';
}; };
buildHook = mkOption { buildHook = mkOption {
type = types.string; type = types.string;
default = "true"; default = "true";
description = '' description = ''
Command run while building the Upstart job. Can be used Command run while building the Upstart job. Can be used
to perform simple regression tests (e.g., the Apache to perform simple regression tests (e.g., the Apache
Upstart job uses it to check the syntax of the generated Upstart job uses it to check the syntax of the generated
<filename>httpd.conf</filename>. <filename>httpd.conf</filename>.
''; '';
}; };
description = mkOption { description = mkOption {
type = types.string; type = types.string;
default = "(no description given)"; default = "(no description given)";
description = '' description = ''
A short description of this job. A short description of this job.
''; '';
}; };
startOn = mkOption { startOn = mkOption {
# !!! Re-enable this once we're on Upstart >= 0.6. # !!! Re-enable this once we're on Upstart >= 0.6.
#type = types.string; #type = types.string;
default = ""; default = "";
description = '' description = ''
The Upstart event that triggers this job to be started. The Upstart event that triggers this job to be started.
If empty, the job will not start automatically. If empty, the job will not start automatically.
''; '';
}; };
stopOn = mkOption { stopOn = mkOption {
type = types.string; type = types.string;
default = "shutdown"; default = "shutdown";
description = '' description = ''
The Upstart event that triggers this job to be stopped. The Upstart event that triggers this job to be stopped.
''; '';
}; };
preStart = mkOption { preStart = mkOption {
type = types.string; type = types.string;
default = ""; default = "";
description = '' description = ''
Shell commands executed before the job is started Shell commands executed before the job is started
(i.e. before the job's main process is started). (i.e. before the job's main process is started).
''; '';
}; };
postStop = mkOption { postStop = mkOption {
type = types.string; type = types.string;
default = ""; default = "";
description = '' description = ''
Shell commands executed after the job has stopped Shell commands executed after the job has stopped
(i.e. after the job's main process has terminated). (i.e. after the job's main process has terminated).
''; '';
}; };
exec = mkOption { exec = mkOption {
type = types.string; type = types.string;
default = ""; default = "";
description = '' description = ''
Command to start the job's main process. If empty, the Command to start the job's main process. If empty, the
job has no main process, but can still have pre/post-start job has no main process, but can still have pre/post-start
and pre/post-stop scripts, and is considered "running" and pre/post-stop scripts, and is considered "running"
until it is stopped. until it is stopped.
''; '';
}; };
script = mkOption { script = mkOption {
type = types.string; type = types.string;
default = ""; default = "";
description = '' description = ''
Shell commands executed as the job's main process. Can be Shell commands executed as the job's main process. Can be
specified instead of the <varname>exec</varname> attribute. specified instead of the <varname>exec</varname> attribute.
''; '';
}; };
respawn = mkOption { respawn = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = '' description = ''
Whether to restart the job automatically if its process Whether to restart the job automatically if its process
ends unexpectedly. ends unexpectedly.
''; '';
}; };
task = mkOption { task = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
Whether this job is a task rather than a service. Tasks Whether this job is a task rather than a service. Tasks
are executed only once, while services are restarted when are executed only once, while services are restarted when
they exit. they exit.
''; '';
}; };
environment = mkOption { environment = mkOption {
type = types.attrs; type = types.attrs;
default = {}; default = {};
example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; }; example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; };
description = '' description = ''
Environment variables passed to the job's processes. Environment variables passed to the job's processes.
''; '';
}; };
extraConfig = mkOption { extraConfig = mkOption {
type = types.string; type = types.string;
default = ""; default = "";
example = "limit nofile 4096 4096"; example = "limit nofile 4096 4096";
description = '' description = ''
Additional Upstart stanzas not otherwise supported. Additional Upstart stanzas not otherwise supported.
''; '';
}; };
}; };
upstartJob = {name, config, ...}: { upstartJob = {name, config, ...}: {
options = { options = {
upstartPkg = mkOption { upstartPkg = mkOption {