Advertisement
cirrus

autologin-getty

Dec 30th, 2012
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. #
  2. # ~/.bash_profile
  3. #
  4.  
  5. [[ -f ~/.bashrc ]] && . ~/.bashrc
  6. vt=$(fgconsole 2>/dev/null)
  7. (( vt == 1 )) && exec startx -- vt$vt &> ~/.xlog
  8. unset vt
  9. --------------------------------------------------------------------------
  10.  
  11. #/etc/systemd/system/autologin@.service
  12. #/etc/systemd/system/getty.target.wantsgetty@tty1.service
  13. # This file is part of systemd.
  14. #
  15. # systemd is free software; you can redistribute it and/or modify it
  16. # under the terms of the GNU Lesser General Public License as published by
  17. # the Free Software Foundation; either version 2.1 of the License, or
  18. # (at your option) any later version.
  19.  
  20. [Unit]
  21. Description=Getty on %I
  22. Documentation=man:agetty(8)
  23. After=systemd-user-sessions.service plymouth-quit-wait.service
  24. After=rc-local.service
  25.  
  26. # If additional gettys are spawned during boot then we should make
  27. # sure that this is synchronized before getty.target, even though
  28. # getty.target didn't actually pull it in.
  29. Before=getty.target
  30. IgnoreOnIsolate=yes
  31.  
  32. # On systems without virtual consoles, don't start any getty. (Note
  33. # that serial gettys are covered by serial-getty@.service, not this
  34. # unit
  35. ConditionPathExists=/dev/tty0
  36.  
  37. [Service]
  38. Environment=TERM=linux
  39. # the VT is cleared by TTYVTDisallocate
  40. ExecStart=-/sbin/agetty --noclear -a USERNAME %I 38400
  41. Type=idle
  42. Restart=always
  43. RestartSec=0
  44. UtmpIdentifier=%I
  45. TTYPath=/dev/%I
  46. TTYReset=yes
  47. TTYVHangup=yes
  48. TTYVTDisallocate=yes
  49. KillMode=process
  50. IgnoreSIGPIPE=no
  51.  
  52. # Unset locale for the console getty since the console has problems
  53. # displaying some internationalized messages.
  54. 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=
  55.  
  56. # Some login implementations ignore SIGTERM, so we send SIGHUP
  57. # instead, to ensure that login terminates cleanly.
  58. KillSignal=SIGHUP
  59.  
  60. [Install]
  61. Alias=getty.target.wants/getty@tty1.service
  62. ------------------------------------------------------------------------------------------------------
  63. # systemctl daemon-reload
  64. # systemctl disable getty@tty1
  65. # systemctl enable autologin@tty1
  66. # systemctl start autologin@tty1
  67. # systemctl enable multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement