Code Monkey home page Code Monkey logo

Comments (2)

kreijack avatar kreijack commented on July 22, 2024

I recently face the same issue. I solved using /sbin/agetty instead of /bin/login.
ExecStart=/usr/bin/kmscon "--vt=%I" --seats=seat0 --no-switchvt -l /sbin/agetty -- -o '-p -- \u' --noclear - linux
image

Unfortunately doing this, no terminal identifier is printed (only a '-'). I developed a patch (https://github.com/kreijack/kmscon/tree/ptsname) which allow to pass '{ptsname}' in agetty command line, which will be replace by the terminal name (like 'pts/1').
'
ExecStart=/usr/bin/kmscon "--vt=%I" --seats=seat0 --no-switchvt -l /sbin/agetty -- -o '-p -- \u' --noclear {ptsname} linux
'
image

I even tried to implement the printing of /etc/issue in kmscon (https://github.com/kreijack/kmscon/tree/random-dev), but it is a lot of code (you have to take care of a lot of '<character>' code); moreover /bin/login has a timeout so if no key is pressed at login time, it exit and kmscon has to restart it.

Both of these issues disappear using /sbin/agetty instead of /bin/login.

Unfortunately, there is still noway to show the tty.

from kmscon.

 avatar commented on July 22, 2024

@kreijack
If the only thing you really care about is printing, not actually passing the terminal value to agetty, you can do:

/usr/bin/kmscon "--vt=/dev/tty2" --seats=seat0 --no-switchvt -l /bin/bash -- -c "tty; /sbin/agetty -o \"-p -- \u\" - linux"

For some reason, substituting it like this:

/usr/bin/kmscon "--vt=/dev/tty2" --seats=seat0 --no-switchvt -l /bin/bash -- -c "/sbin/agetty -o \"-p -- \u\" `tty` linux"

did not really work.

You can get the VT (not PT) number with $XDG_VTNR instead.

from kmscon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.