From 9f5051b76c128987975c1aad3d2f9756fe0ccd03 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 18 Jun 2012 17:55:27 -0400 Subject: [PATCH] Rename mingetty module to agetty --- modules/module-list.nix | 2 +- .../ttys/{mingetty.nix => agetty.nix} | 49 ++++++++++++------- modules/system/boot/systemd.nix | 40 +-------------- 3 files changed, 34 insertions(+), 57 deletions(-) rename modules/services/ttys/{mingetty.nix => agetty.nix} (57%) diff --git a/modules/module-list.nix b/modules/module-list.nix index 04fa9c58ec6..2aa34cb205f 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 similarity index 57% rename from modules/services/ttys/mingetty.nix rename to modules/services/ttys/agetty.nix index 8304ca180cb..f70cbe74d67 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 { + boot.systemd.units."getty@.service".text = + '' + [Unit] + Description=Getty on %I + Documentation=man:agetty(8) + After=systemd-user-sessions.service plymouth-quit-wait.service - 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 + # 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 - 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); - */ + [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 906558bd695..f41e471cb1b 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; };