You are not logged in.
The reason I even considered autologin is so that after the user did login and wants to startx it would go to tt7, but I am unable to do so, wiki points to some utility that is not there anymore.
Which wiki page? What utility? It's not where anymore?
You could set up everything for autologin on one tty and autologin into X, but just not enable that service. Then to do so on demand, you'd just start the relevant custom getty service from whichever kmscon tty you are on (e.g., `systemctl start mygetty@ttyN`)
Last edited by Trilby (2023-08-18 20:32:51)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
What would stop you from just switching the VT to tty7, logging in there and running startx?
Edit: xserverrc, there used to be a systemd-multi-seat-x tool to facilitate a rootless X11 server on a different than the logind-activated TTY
Last edited by seth (2023-08-18 20:35:05)
Offline
me_231231 wrote:The reason I even considered autologin is so that after the user did login and wants to startx it would go to tt7, but I am unable to do so, wiki points to some utility that is not there anymore.
Which wiki page? What utility? It's not where anymore?
You could set up everything for autologin on one tty and autologin into X, but just not enable that service. Then to do so on demand, you'd just start the relevant custom getty service from whichever kmscon tty you are on (e.g., `systemctl start mygetty@ttyN`)
I want autologin only on demand because I dont want any user to login automatically into the machine. What is mygetty, I have not seen such a program?
Does mingetty or mgetty support running from foreground? Or should I just instead create a getty@tty7.service file with autologin in configuration without enabling it and starting it only on demand?
Offline
https://wiki.archlinux.org/title/Getty
https://wiki.archlinux.org/title/Getty# … l_consoles
I don't think you'd need any other getty for the approach in #26
Offline
"mygetty" was a placeholder name for a getty service file that you'd create.
Or should I just instead create a getty@tty7.service file with autologin in configuration without enabling it and starting it only on demand?
That's precisely what I was suggesting - other than the tty7 specificity, though if that's where you want it, have at it.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thank you all, I was able to make a script that would change from KMSCON into tty7 and startx there.
Here is the simple script that I wrote:
#!/bin/bash
sudo chvt 7
sudo systemctl start dk_getty7And the code for the dk_getty7systemd service:
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Getty on tty7 for dk
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=https://0pointer.de/blog/projects/serial-console.html
After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
# 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
# IgnoreOnIsolate causes issues with sulogin, if someone isolates
# rescue.target or starts rescue.service from multi-user.target or
# graphical.target.
Conflicts=rescue.service
Before=rescue.service
# On systems without virtual consoles, don't start any getty. Note
# that serial gettys are covered by serial-getty@.service, not this
# unit.
ConditionPathExists=/dev/tty0
[Service]
# the VT is cleared by TTYVTDisallocate
# The '-o' option value tells agetty to replace 'login' arguments with an
# option to preserve environment (-p), followed by '--' for safety, and then
# the entered username.
ExecStart=/sbin/agetty -o '-p -f -- \\u' --noclear --autologin dk tty7 linux
Type=idle
Restart=never
RestartSec=0
UtmpIdentifier=tty7
StandardInput=tty
StandardOutput=tty
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
IgnoreSIGPIPE=no
SendSIGHUP=yes
ImportCredential=agetty.*
ImportCredential=login.*
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
UnsetEnvironment=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
[Install]
WantedBy=getty.target
DefaultInstance=tty7For graphical framebuffer console I used KMSCON without any problems.
Offline