Remove remaining references to Upstart
This commit is contained in:
@@ -116,18 +116,10 @@ in
|
||||
mkdir -m 0755 -p /var/run/nix/current-load # for distributed builds
|
||||
mkdir -m 0700 -p /var/run/nix/remote-stores
|
||||
|
||||
# Directory holding symlinks to currently running Upstart
|
||||
# jobs. Used to determine which jobs need to be restarted
|
||||
# when switching to a new configuration.
|
||||
mkdir -m 0700 -p /var/run/upstart-jobs
|
||||
|
||||
mkdir -m 0755 -p /var/log
|
||||
|
||||
touch /var/log/wtmp # must exist
|
||||
chmod 644 /var/log/wtmp
|
||||
|
||||
touch /var/log/lastlog
|
||||
chmod 644 /var/log/lastlog
|
||||
touch /var/log/wtmp /var/log/lastlog # must exist
|
||||
chmod 644 /var/log/wtmp /var/log/lastlog
|
||||
|
||||
mkdir -m 1777 -p /var/tmp
|
||||
|
||||
|
||||
@@ -80,9 +80,9 @@ let
|
||||
|
||||
# Putting it all together. This builds a store path containing
|
||||
# symlinks to the various parts of the built configuration (the
|
||||
# kernel, the Upstart services, the init scripts, etc.) as well as a
|
||||
# script `switch-to-configuration' that activates the configuration
|
||||
# and makes it bootable.
|
||||
# kernel, systemd units, init scripts, etc.) as well as a script
|
||||
# `switch-to-configuration' that activates the configuration and
|
||||
# makes it bootable.
|
||||
system = pkgs.stdenv.mkDerivation {
|
||||
name = "nixos-${config.system.nixosVersion}";
|
||||
preferLocalBuild = true;
|
||||
@@ -99,15 +99,6 @@ let
|
||||
activationScript = config.system.activationScripts.script;
|
||||
nixosVersion = config.system.nixosVersion;
|
||||
|
||||
jobs = map (j: j.name) (attrValues config.jobs);
|
||||
|
||||
# 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);
|
||||
|
||||
# Pass the names of all Upstart jobs that shouldn't be restarted
|
||||
# to the activation script.
|
||||
noRestartIfChanged = attrValues (mapAttrs (n: v: if v.restartIfChanged then [] else ["[${v.name}]=1"]) config.jobs);
|
||||
|
||||
configurationName = config.boot.loader.grub.configurationName;
|
||||
|
||||
# Needed by switch-to-configuration.
|
||||
|
||||
@@ -107,17 +107,18 @@ let
|
||||
type = types.str;
|
||||
example = "sshd";
|
||||
description = ''
|
||||
Name of the Upstart job.
|
||||
Name of the job, mapped to the systemd unit
|
||||
<literal><replaceable>name</replaceable>.service</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
startOn = mkOption {
|
||||
# !!! Re-enable this once we're on Upstart >= 0.6.
|
||||
#type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
The Upstart event that triggers this job to be started.
|
||||
If empty, the job will not start automatically.
|
||||
The Upstart event that triggers this job to be started. Some
|
||||
are mapped to systemd dependencies; otherwise you will get a
|
||||
warning. If empty, the job will not start automatically.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -125,7 +126,7 @@ let
|
||||
type = types.str;
|
||||
default = "starting shutdown";
|
||||
description = ''
|
||||
The Upstart event that triggers this job to be stopped.
|
||||
Ignored; this was the Upstart event that triggers this job to be stopped.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -144,7 +145,7 @@ let
|
||||
default = "";
|
||||
description = ''
|
||||
Shell commands executed before the job is stopped
|
||||
(i.e. before Upstart kills the job's main process). This can
|
||||
(i.e. before systemd kills the job's main process). This can
|
||||
be used to cleanly shut down a daemon.
|
||||
'';
|
||||
};
|
||||
@@ -192,7 +193,7 @@ let
|
||||
type = types.str;
|
||||
default = "none";
|
||||
description = ''
|
||||
Determines how Upstart detects when a daemon should be
|
||||
Determines how systemd detects when a daemon should be
|
||||
considered “running”. The value <literal>none</literal> means
|
||||
that the daemon is considered ready immediately. The value
|
||||
<literal>fork</literal> means that the daemon will fork once.
|
||||
@@ -261,8 +262,13 @@ in
|
||||
jobs = mkOption {
|
||||
default = {};
|
||||
description = ''
|
||||
This option defines the system jobs started and managed by the
|
||||
Upstart daemon.
|
||||
This option is a legacy method to define system services,
|
||||
dating from the era where NixOS used Upstart instead of
|
||||
systemd. You should use <option>systemd.services</option>
|
||||
instead. Services defined using <option>jobs</option> are
|
||||
mapped automatically to <option>systemd.services</option>, but
|
||||
may not work perfectly; in particular, most
|
||||
<option>startOn</option> conditions are not supported.
|
||||
'';
|
||||
type = types.loaOf types.optionSet;
|
||||
options = [ jobOptions upstartJob ];
|
||||
|
||||
Reference in New Issue
Block a user