about summary refs log tree commit diff
path: root/modules/services/ttys
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-06-18 17:55:27 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-06-18 17:55:27 -0400
commit9f5051b76c128987975c1aad3d2f9756fe0ccd03 (patch)
treea6f64ccc1874af6c70e172c3eec18469ba6ed8fb /modules/services/ttys
parent4c21857ee1173d303b6c1f2964d46b677adc0ee5 (diff)
downloadnixlib-9f5051b76c128987975c1aad3d2f9756fe0ccd03.tar
nixlib-9f5051b76c128987975c1aad3d2f9756fe0ccd03.tar.gz
nixlib-9f5051b76c128987975c1aad3d2f9756fe0ccd03.tar.bz2
nixlib-9f5051b76c128987975c1aad3d2f9756fe0ccd03.tar.lz
nixlib-9f5051b76c128987975c1aad3d2f9756fe0ccd03.tar.xz
nixlib-9f5051b76c128987975c1aad3d2f9756fe0ccd03.tar.zst
nixlib-9f5051b76c128987975c1aad3d2f9756fe0ccd03.zip
Rename mingetty module to agetty
Diffstat (limited to 'modules/services/ttys')
-rw-r--r--modules/services/ttys/agetty.nix (renamed from modules/services/ttys/mingetty.nix)55
1 files changed, 35 insertions, 20 deletions
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" ''