about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-31 13:26:06 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-31 13:26:06 +0100
commitc1159edc65989d6b33aa68e0822ec6e388576b8e (patch)
tree6f15c91b1f24c7a360d1fbd76548bbe1a655d105 /nixos
parent456d8ec52b640ff67c88d04c89ea59836953b38f (diff)
downloadnixlib-c1159edc65989d6b33aa68e0822ec6e388576b8e.tar
nixlib-c1159edc65989d6b33aa68e0822ec6e388576b8e.tar.gz
nixlib-c1159edc65989d6b33aa68e0822ec6e388576b8e.tar.bz2
nixlib-c1159edc65989d6b33aa68e0822ec6e388576b8e.tar.lz
nixlib-c1159edc65989d6b33aa68e0822ec6e388576b8e.tar.xz
nixlib-c1159edc65989d6b33aa68e0822ec6e388576b8e.tar.zst
nixlib-c1159edc65989d6b33aa68e0822ec6e388576b8e.zip
Remove remaining references to Upstart
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/firewall.nix7
-rw-r--r--nixos/modules/services/networking/gogoclient.nix23
-rw-r--r--nixos/modules/services/networking/openvpn.nix8
-rw-r--r--nixos/modules/system/activation/activation-script.nix12
-rw-r--r--nixos/modules/system/activation/top-level.nix15
-rw-r--r--nixos/modules/system/upstart/upstart.nix24
-rw-r--r--nixos/modules/virtualisation/ec2-data.nix4
-rw-r--r--nixos/modules/virtualisation/libvirtd.nix5
8 files changed, 39 insertions, 59 deletions
diff --git a/nixos/modules/services/networking/firewall.nix b/nixos/modules/services/networking/firewall.nix
index 4ed859c2e7ea..3c0c51e6ec8a 100644
--- a/nixos/modules/services/networking/firewall.nix
+++ b/nixos/modules/services/networking/firewall.nix
@@ -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" ];
diff --git a/nixos/modules/services/networking/gogoclient.nix b/nixos/modules/services/networking/gogoclient.nix
index 07c35e3cb3d6..3b92eb8b06bd 100644
--- a/nixos/modules/services/networking/gogoclient.nix
+++ b/nixos/modules/services/networking/gogoclient.nix
@@ -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.";
       };
     };
   };
diff --git a/nixos/modules/services/networking/openvpn.nix b/nixos/modules/services/networking/openvpn.nix
index 400cb74f7d9f..292d45f43475 100644
--- a/nixos/modules/services/networking/openvpn.nix
+++ b/nixos/modules/services/networking/openvpn.nix
@@ -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.
       '';
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix
index b502484a5203..e012c977164e 100644
--- a/nixos/modules/system/activation/activation-script.nix
+++ b/nixos/modules/system/activation/activation-script.nix
@@ -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
 
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index 6fd8bf241f50..ada961316755 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -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.
diff --git a/nixos/modules/system/upstart/upstart.nix b/nixos/modules/system/upstart/upstart.nix
index 464041ebe6b2..aa5c8dfe64b2 100644
--- a/nixos/modules/system/upstart/upstart.nix
+++ b/nixos/modules/system/upstart/upstart.nix
@@ -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 ];
diff --git a/nixos/modules/virtualisation/ec2-data.nix b/nixos/modules/virtualisation/ec2-data.nix
index fccf45e0e193..5133a98cd962 100644
--- a/nixos/modules/virtualisation/ec2-data.nix
+++ b/nixos/modules/virtualisation/ec2-data.nix
@@ -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, ... }:
diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix
index 280143d4e3f2..d3884a503bc7 100644
--- a/nixos/modules/virtualisation/libvirtd.nix
+++ b/nixos/modules/virtualisation/libvirtd.nix
@@ -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 ];