LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to set /dev/tty as living log? (https://www.linuxquestions.org/questions/slackware-14/how-to-set-dev-tty-as-living-log-4175641734/)

igadoter 11-04-2018 05:34 AM

How to set /dev/tty as living log?
 
Hi,
I found this in very old book abou UNIX administration
Code:

$ write  foo > /dev/tty
I came to idea to redirect output of commands in similar way, eg.
Code:

$ mirror-slackware-current.sh > /dev/tty5
It works now. But still I have to login using /dev/tty5. I want this device to work without shell. I don't know I am clear enough. Commonly switching to /dev/tty5 ones is being welcomed and prompted to provide name and password. I want that switching to /dev/tty5 just opens plain screen - no system welcome. no prompt, no possibility to use /dev/tty5 as login device. It just should show eg. output of command as above.

Didier Spaier 11-04-2018 06:37 AM

That would need several modifications:
  • In /etc/inittab, comment out this line:
    Code:

    c4:12345:respawn:/sbin/agetty 38400 tty5 linux
  • Create the device if need be. As done in the Slackware installer:
    Code:

      if [ ! -r /dev/tty5 ]; then
        mknod /dev/tty5 c 4 5
        chown root:tty /dev/tty5
        chmod 620 /dev/tty5
      fi

Good luck.

PS Caveat: you probably won't be able to scroll up or down in /dev/tty5

igadoter 11-04-2018 08:46 AM

Quote:

Originally Posted by Didier Spaier (Post 5922690)
[*]In /etc/fstab , comment out this line:
Code:

c4:12345:respawn:/sbin/agetty 38400 tty5 linux

I suppose it is about /etc/inittab, /etc/fstab contains partition to auto mount.

No matter
Code:

$ echo foo > /dev/tty8
is enough. I suppose kernel just open this device. The only restriction is the user has to belong to tty group.

Didier Spaier 11-04-2018 11:23 AM

Quote:

Originally Posted by igadoter (Post 5922707)
I suppose it is about /etc/inittab, /etc/fstab contains partition to auto moun.

Yes, fixed.


All times are GMT -5. The time now is 03:06 AM.