Rename mingetty module to agetty

This commit is contained in:
Eelco Dolstra 2012-06-18 17:55:27 -04:00
parent 4c21857ee1
commit 9f5051b76c
3 changed files with 34 additions and 57 deletions

View File

@ -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

View File

@ -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" ''

View File

@ -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;
};