LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-01-2003, 01:51 AM   #1
adrianphicks
LQ Newbie
 
Registered: Aug 2003
Location: Singapore
Posts: 4

Rep: Reputation: 0
Angry Need to switch tty or send system msgs to tty2


We are testing a linux box as reader of barcodes for our timeclock.

I want the box to be able to come up in its working state if, for example, the power goes off & comes back on.

We're able to get it to log in automatically & run the PHP script that reads the barcodes, however system messages are sent to tty1 & this interferes with the PHP script that sends barcodes to the timeclock database.

Haven't yet been able to find an automated way to switch to tty2 so we can run the PHP script there. Anyone know how?

Or if we can send all the system messages to tty2 that would be fine also.

Adrian Hicks
 
Old 08-01-2003, 07:33 PM   #2
slapNUT
Member
 
Registered: Jun 2001
Location: Recycle Bin
Distribution: Linux & Everything else on VirtualBox
Posts: 144

Rep: Reputation: 15
agetty will alow you to specify an alternate file to run besides /sbin/login. So you can use that to run a program on another tty by editing the /etc/inittab file:

Example: I can bypass the login by making agetty run /bin/bash on tty2.
Code:
# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/agetty -l /bin/bash 9600 tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
There is more info available in man agetty.

NOTE the baud rate is necessary, it will not work without it, but I just use 9600 as an example.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a way to switch to a tty with a command? sh0 Linux - Software 3 12-17-2009 08:26 PM
kdm is starting up on tty2 instead of tty7 peterrobin Linux - General 7 09-02-2004 03:05 AM
change tty => system crashes (ati driver/tty resolution) mosca Debian 6 08-05-2004 07:37 AM
Slack 10.0 + bootsplash + tty2-6 lucas22 Slackware 4 07-30-2004 12:04 PM
X Keyboard no response. Something to do with xfree on tty2 smehi Linux - Software 0 06-03-2004 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration