Remove remaining references to Upstart

This commit is contained in:
Eelco Dolstra 2013-10-31 13:26:06 +01:00
parent 456d8ec52b
commit c1159edc65
8 changed files with 39 additions and 59 deletions

View File

@ -215,11 +215,8 @@ in
###### implementation
# !!! Maybe if `enable' is false, the firewall should still be built
# but not started by default. However, currently nixos-rebuild
# doesn't deal with such Upstart jobs properly (it starts them if
# they are changed, regardless of whether the start condition
# holds).
# FIXME: Maybe if `enable' is false, the firewall should still be
# built but not started by default?
config = mkIf cfg.enable {
networking.firewall.trustedInterfaces = [ "lo" ];

View File

@ -15,38 +15,35 @@ in
default = false;
type = types.bool;
description = ''
Enable the gogoclient ipv6 tunnel.
Enable the gogoCLIENT IPv6 tunnel.
'';
};
autorun = mkOption {
default = true;
description = "
Switch to false to create upstart-job and configuration,
but not run it automatically
";
description = ''
Whether to automatically start the tunnel.
'';
};
username = mkOption {
default = "";
description = "
description = ''
Your Gateway6 login name, if any.
";
'';
};
password = mkOption {
default = "";
type = types.string;
description = "
Path to a file (as a string), containing your gogonet password, if any.
";
description = ''
Path to a file (as a string), containing your gogoNET password, if any.
'';
};
server = mkOption {
default = "anonymous.freenet6.net";
example = "broker.freenet6.net";
description = "
Used Gateway6 server.
";
description = "The Gateway6 server to be used.";
};
};
};

View File

@ -107,10 +107,10 @@ in
'';
description = ''
Each attribute of this option defines an Upstart job to run an
OpenVPN instance. These can be OpenVPN servers or clients.
The name of each Upstart job is
<literal>openvpn-</literal><replaceable>name</replaceable>,
Each attribute of this option defines a systemd service that
runs an OpenVPN instance. These can be OpenVPN servers or
clients. The name of each systemd service is
<literal>openvpn-<replaceable>name</replaceable>.service</literal>,
where <replaceable>name</replaceable> is the corresponding
attribute name.
'';

View File

@ -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

View File

@ -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.

View File

@ -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 ];

View File

@ -1,5 +1,5 @@
# This module defines an Upstart job that obtains the SSH key and host
# name of virtual machines running on Amazon EC2, Eucalyptus and
# This module defines a systemd service that obtains the SSH key and
# host name of virtual machines running on Amazon EC2, Eucalyptus and
# OpenStack Compute (Nova).
{ config, pkgs, ... }:

View File

@ -1,4 +1,4 @@
# Upstart jobs for libvirtd.
# Systemd services for libvirtd.
{ config, pkgs, ... }:
@ -122,9 +122,6 @@ in
wants = [ "libvirtd.service" ];
after = [ "libvirtd.service" ];
# We want to suspend VMs only on shutdown, but Upstart is broken.
#stopOn = "";
restartIfChanged = false;
path = [ pkgs.gettext pkgs.libvirt pkgs.gawk ];