WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: setup auto login on TTY2  (Read 2946 times)

Offline evilbob

  • Newbie
  • *
  • Posts: 4
setup auto login on TTY2
« on: October 19, 2010, 12:17:49 PM »
Hello I have tried searching but it has not helped me so now I have to ask.

I installed Tiny Core to a hard drive and am using the "Quiet, text, and multivt" boot codes.
I then set up my opt/.filetool.lst to include /etc/inittab

I added kill -1 1 to my opt/bootlocal.sh

In inettab I uncommented the lines for TTY2 - TTY6 and added --autologin root so it looks like this
tty2::respawn:/sbin/getty 38400 tty2 --autologin root

Also tried
tty2::respawn:/sbin/getty 38400 tty2 -u root

Also tried to change it to use rungetty
tty2::respawn:/sbin/rungetty tty2 --autologin root

no matter what I try It will not autologin it will prompt for a user and password or not work at all.

I am fairly new to linux and not experienced with Getty or Virtual terminals so please over explain if you can.

The goal is to have a TN5250 Terminal emulator load automatically and have each tty represent a different session. allowing a user to switch between sessions without having to type anything.

Thanks for reading this.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: setup auto login on TTY2
« Reply #1 on: October 19, 2010, 03:29:58 PM »
I've been down this road. Autologin only works for tty1 and only for the first login. I'd suggest simply running tn5250 from /etc/inittab. I use this:

tty2::respawn:/sbin/rungetty -u tc -g staff tty2 -- /usr/bin/tail -f /var/log/messages

to put syslog on virtual terminal 2.

I put this in my /opt/bootlocal.sh:

# Wait for init to finish then reload it
wait $PPID
sleep 1
kill -SIGHUP 1

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: setup auto login on TTY2
« Reply #2 on: October 19, 2010, 05:04:54 PM »
I'm not in a position to comment on the finer points of your changes to '/etc/inittab'. The way I read it you attempted to modify '/etc/inittab' and ensure persistence via backup (i.e. include 'etc/inittab' in '/opt/.filetool.lst'). I'm pretty certain that will never achieve what you hope for:

AFAIK the restoration from backup happens too late in the boot process to replace the '/etc/inittab' file from the initrd (i.e. 'tinycore.gz') with your modified version. IIRC the restoration is done via '/etc/init.d/tc-restore.sh' which gets called almost at the very end of the execution of '/etc/init.d/tc-config'. Unfortunately the restoration takes place before you get access to the system, and when you (after the boot process is complete) look at the file content you'll probably see the modified content. That is when you start scratching your head ...

Therefore the only way I imagine that you achieve a different outcome would be via remastering of the initrd (and if you boot using a CD-ROM also remastering of the ISO image).

If you take a look at '/init' you'll find that the 'multivt' boot code actually does a change of the '/etc/inittab' content by overwriting it with '/etc/inittab-save'. All this has to happen befor '/sbin/init' is called. Therefore I'd suggest you modify '/etc/inittab' and NOT use boot code 'multivt' (or change '/etc/inittab-save' if you want to continue to use boot code 'multivt').

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: setup auto login on TTY2
« Reply #3 on: October 19, 2010, 05:49:33 PM »
Although this is correct, adding 'kill -1 1'  to bootlocal.sh ( as the OP did ) will cause inittab to be reread and all changes will take effect.

Offline evilbob

  • Newbie
  • *
  • Posts: 4
Re: setup auto login on TTY2
« Reply #4 on: October 20, 2010, 12:34:42 PM »
Thanks to everyone for the replys.
Here is what I finally got to work.
 
I am loading TN5250 in the/etc/inittab

The magic lines look like this.
tty2::respawn:/usr/local/bin/th5250 env.DEVNAME= (session name) host.localdomain

Just repeat that line for as many sessions as you need. Change the tty and the session name.

The other file to modify is the /opt/bootlocal.sh
I copied from danielibarnes

# Wait for init to finish then reload it
wait $PPID
sleep 1
kill -SIGHUP 1