LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-07-2012, 09:33 PM   #1
yplasse
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Rep: Reputation: 2
TTY Console and pppd on same ttyS


Depending on the presence of a file, I want to either enable pppd or set a console on ttyS3. I installed the following script code in rc.local to attempt to do it:

ADIEXEC="/home/adi/exec"
if [ -f $ADIEXEC/RECOVERY.MOD ];
then
echo --- RECOVERY mode: ttyS3 is set as Serial Console
/sbin/agetty -L ttyS3 9600 vt100
else
if [ -f $ADIEXEC/TSTNORMA.MOD ]
then
echo --- TEST NORNAL mode: ttyS3 is used for PPP link
else
echo --- NORMAL mode: ttyS3 is used for PPP link
fi
pppd
fi

When I am in 'Recovery' mode, an attempt is made to run agetty. The boot sequence hangs but I am able to log on ttyS3. Normally agetty is run with inittab.

Is there a way to enable a serial console depending on a condition like above?

Thank you, Yves Plasse.
 
Old 02-08-2012, 01:25 PM   #2
yplasse
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 2
I found a way to solve this problem. Apparently, it looks that the runlevel 2 is user definable on Slackware. According to some remarks in inittab, it is configured as the default runlevel 3. If I assign only the priority 2 to S2 for ttyS3 like the following, this one would be assigned as a serial console only at this RunLevel.

S2:2:respawn:/sbin/agetty -L ttyS3 9600 vt100

In rc.local, I can change the runlevel and ask init to review inittab when I discover that I am in recovery mode as following:

if [ -f $ADIEXEC/RECOVERY.MOD ];
then
echo --- RECOVERY mode: ttyS3 is set as Serial Console
init 2
else
...

Yves Plasse.

Last edited by yplasse; 02-08-2012 at 07:56 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot switch ttys in console Bratmon Linux - General 13 07-19-2010 09:13 AM
How to print a message from kernel module to terminal console or tty console yogesh_bansal Linux - Newbie 2 02-27-2009 10:10 AM
Problems with console TTYs Tortanick Linux - Laptop and Netbook 4 07-07-2008 03:32 AM
difference between tty & ttyS venkat_p257 Linux - Hardware 1 12-12-2007 01:47 PM
difference between console, tty and ttyS localp Slackware 1 08-12-2007 02:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:43 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration