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

View file

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

View file

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

View file

@ -116,18 +116,10 @@ in
mkdir -m 0755 -p /var/run/nix/current-load # for distributed builds mkdir -m 0755 -p /var/run/nix/current-load # for distributed builds
mkdir -m 0700 -p /var/run/nix/remote-stores 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 mkdir -m 0755 -p /var/log
touch /var/log/wtmp # must exist touch /var/log/wtmp /var/log/lastlog # must exist
chmod 644 /var/log/wtmp chmod 644 /var/log/wtmp /var/log/lastlog
touch /var/log/lastlog
chmod 644 /var/log/lastlog
mkdir -m 1777 -p /var/tmp mkdir -m 1777 -p /var/tmp

View file

@ -80,9 +80,9 @@ let
# Putting it all together. This builds a store path containing # Putting it all together. This builds a store path containing
# symlinks to the various parts of the built configuration (the # symlinks to the various parts of the built configuration (the
# kernel, the Upstart services, the init scripts, etc.) as well as a # kernel, systemd units, init scripts, etc.) as well as a script
# script `switch-to-configuration' that activates the configuration # `switch-to-configuration' that activates the configuration and
# and makes it bootable. # makes it bootable.
system = pkgs.stdenv.mkDerivation { system = pkgs.stdenv.mkDerivation {
name = "nixos-${config.system.nixosVersion}"; name = "nixos-${config.system.nixosVersion}";
preferLocalBuild = true; preferLocalBuild = true;
@ -99,15 +99,6 @@ let
activationScript = config.system.activationScripts.script; activationScript = config.system.activationScripts.script;
nixosVersion = config.system.nixosVersion; 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; configurationName = config.boot.loader.grub.configurationName;
# Needed by switch-to-configuration. # Needed by switch-to-configuration.

View file

@ -107,17 +107,18 @@ let
type = types.str; type = types.str;
example = "sshd"; example = "sshd";
description = '' description = ''
Name of the Upstart job. Name of the job, mapped to the systemd unit
<literal><replaceable>name</replaceable>.service</literal>.
''; '';
}; };
startOn = mkOption { startOn = mkOption {
# !!! Re-enable this once we're on Upstart >= 0.6.
#type = types.str; #type = types.str;
default = ""; default = "";
description = '' description = ''
The Upstart event that triggers this job to be started. The Upstart event that triggers this job to be started. Some
If empty, the job will not start automatically. 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; type = types.str;
default = "starting shutdown"; default = "starting shutdown";
description = '' 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 = ""; default = "";
description = '' description = ''
Shell commands executed before the job is stopped 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. be used to cleanly shut down a daemon.
''; '';
}; };
@ -192,7 +193,7 @@ let
type = types.str; type = types.str;
default = "none"; default = "none";
description = '' 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 considered running. The value <literal>none</literal> means
that the daemon is considered ready immediately. The value that the daemon is considered ready immediately. The value
<literal>fork</literal> means that the daemon will fork once. <literal>fork</literal> means that the daemon will fork once.
@ -261,8 +262,13 @@ in
jobs = mkOption { jobs = mkOption {
default = {}; default = {};
description = '' description = ''
This option defines the system jobs started and managed by the This option is a legacy method to define system services,
Upstart daemon. 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; type = types.loaOf types.optionSet;
options = [ jobOptions upstartJob ]; options = [ jobOptions upstartJob ];

View file

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

View file

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