summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/module-list.nix2
-rw-r--r--modules/services/ttys/agetty.nix (renamed from modules/services/ttys/mingetty.nix)55
-rw-r--r--modules/system/boot/systemd.nix40
3 files changed, 37 insertions, 60 deletions
diff --git a/modules/module-list.nix b/modules/module-list.nix
index 04fa9c58ec6c..2aa34cb205fd 100644
--- a/modules/module-list.nix
+++ b/modules/module-list.nix
@@ -165,7 +165,7 @@
./services/system/nscd.nix
./services/system/uptimed.nix
./services/ttys/gpm.nix
- ./services/ttys/mingetty.nix
+ ./services/ttys/agetty.nix
./services/web-servers/apache-httpd/default.nix
./services/web-servers/jboss/default.nix
./services/web-servers/tomcat.nix
diff --git a/modules/services/ttys/mingetty.nix b/modules/services/ttys/agetty.nix
index 8304ca180cb8..f70cbe74d67b 100644
--- a/modules/services/ttys/mingetty.nix
+++ b/modules/services/ttys/agetty.nix
@@ -10,6 +10,7 @@ with pkgs.lib;
services.mingetty = {
+ # FIXME
ttys = mkOption {
default =
if pkgs.stdenv.isArm
@@ -40,7 +41,7 @@ with pkgs.lib;
helpLine = mkOption {
default = "";
description = ''
- Help line printed by mingetty below the welcome line.
+ Help line printed by mingetty below the welcome line.
Used by the installation CD to give some hints on
how to proceed.
'';
@@ -56,25 +57,39 @@ with pkgs.lib;
config = {
# Generate a separate job for each tty.
- /*
- jobs = listToAttrs (map (tty: nameValuePair tty {
-
- startOn =
- # On tty1 we should always wait for mountall, since it may
- # start an emergency-shell job.
- if config.services.mingetty.waitOnMounts || tty == "tty1"
- then "stopped udevtrigger and filesystem"
- else "stopped udevtrigger"; # !!! should start as soon as the tty device is created
-
- path = [ pkgs.mingetty ];
-
- exec = "mingetty --loginprog=${pkgs.shadow}/bin/login --noclear ${tty}";
-
- environment.LOCALE_ARCHIVE = "/var/run/current-system/sw/lib/locale/locale-archive";
-
- }) config.services.mingetty.ttys);
- */
-
+ boot.systemd.units."getty@.service".text =
+ ''
+ [Unit]
+ Description=Getty on %I
+ Documentation=man:agetty(8)
+ After=systemd-user-sessions.service plymouth-quit-wait.service
+
+ # If additional gettys are spawned during boot then we should make
+ # sure that this is synchronized before getty.target, even though
+ # getty.target didn't actually pull it in.
+ Before=getty.target
+ IgnoreOnIsolate=yes
+
+ [Service]
+ Environment=TERM=linux
+ Environment=LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive
+ ExecStart=@${pkgs.utillinux}/sbin/agetty agetty --noclear --login-program ${pkgs.shadow}/bin/login %I 38400
+ Type=idle
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
+ TTYPath=/dev/%I
+ TTYReset=yes
+ TTYVHangup=yes
+ TTYVTDisallocate=yes
+ KillMode=process
+ IgnoreSIGPIPE=no
+
+ # Some login implementations ignore SIGTERM, so we send SIGHUP
+ # instead, to ensure that login terminates cleanly.
+ KillSignal=SIGHUP
+ '';
+
environment.etc = singleton
{ # Friendly greeting on the virtual consoles.
source = pkgs.writeText "issue" ''
diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix
index 906558bd6956..f41e471cb1bd 100644
--- a/modules/system/boot/systemd.nix
+++ b/modules/system/boot/systemd.nix
@@ -234,42 +234,6 @@ let
KillSignal=SIGHUP
'';
- gettyService =
- ''
- [Unit]
- Description=Getty on %I
- Documentation=man:agetty(8)
- After=systemd-user-sessions.service plymouth-quit-wait.service
-
- # If additional gettys are spawned during boot then we should make
- # sure that this is synchronized before getty.target, even though
- # getty.target didn't actually pull it in.
- Before=getty.target
- IgnoreOnIsolate=yes
-
- [Service]
- Environment=TERM=linux
- ExecStart=-${pkgs.utillinux}/sbin/agetty --noclear --login-program ${pkgs.shadow}/bin/login %I 38400
- Type=idle
- Restart=always
- RestartSec=0
- UtmpIdentifier=%I
- TTYPath=/dev/%I
- TTYReset=yes
- TTYVHangup=yes
- TTYVTDisallocate=yes
- KillMode=process
- IgnoreSIGPIPE=no
-
- # Unset locale for the console getty since the console has problems
- # displaying some internationalized messages.
- Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
-
- # Some login implementations ignore SIGTERM, so we send SIGHUP
- # instead, to ensure that login terminates cleanly.
- KillSignal=SIGHUP
- '';
-
serviceToUnit = name: def:
{ inherit (def) wantedBy;
@@ -407,9 +371,7 @@ in
];
boot.systemd.units =
- { "rescue.service".text = rescueService;
- "getty@.service".text = gettyService;
- }
+ { "rescue.service".text = rescueService; }
// mapAttrs serviceToUnit cfg.services;
};