public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Init single and Serial console : How to ?
@ 2004-07-04  5:09 Paul Rolland
  2004-07-04 10:09 ` Bernd Eckenfels
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Rolland @ 2004-07-04  5:09 UTC (permalink / raw)
  To: linux-kernel

Hello,

I'm trying to activate a serial console on a Linux 2.4.20 (OK, this is not
the
most recent one, but this is the one I'm running).

Configuration is quite simple : at the LILO prompt, I key in :
LILO: linux console=ttyS0 -s

This is supposed to start Linux, and have the console on ttyS0.

The problem is that the bash prompt ends on the monitor, not on the serial
port.

I've read about the :

    ioctlsave is a small utility to create the Linux SysV init file
    /etc/ioctl.save from a multiple user run level rather than from single
    user mode. /etc/ioctl.save contains the terminal settings to be used in
    single user mode. Users of terminals or modems which cannot be
    configured to operate at 9600bps (and thus set ioctl.save using the
    standard mechanism) will find this utility useful. 

but,  the problem is that this operation is only possible if you can have
access to the machine (to run the ioctlsave utility).

When you have a remote machine, for which you have a serial access at boot 
time, but which is not completed its "go to runlevel 3" boot to give you
a serial console, how is it possible to force it to give you a prompt on
the serial port in single mode ?

Regards,
Paul


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Init single and Serial console : How to ?
@ 2004-07-04  6:07 Milton Miller
  2004-07-04  8:44 ` Paul Rolland
  0 siblings, 1 reply; 8+ messages in thread
From: Milton Miller @ 2004-07-04  6:07 UTC (permalink / raw)
  To: Paul Rolland; +Cc: linux-kernel

> Configuration is quite simple : at the LILO prompt, I key in :
> LILO: linux console=ttyS0 -s
...
> The problem is that the bash prompt ends on the monitor, not on the 
> serial
> port.
...
> When you have a remote machine, for which you have a serial access at 
> boot
> time, but which is not completed its "go to runlevel 3" boot to give 
> you
> a serial console, how is it possible to force it to give you a prompt 
> on
> the serial port in single mode ?

Not quite single mode, but what I have done in similar situations is 
boot with
console=ttyS0 init=/bin/sh

which will give a shell on /dev/console before any init scripts have 
run.  At
this point mount -o remount,rw / and edit the inittab (you might need 
to mount
/usr depending on your configuration).   To get back, unmount the 
filesystems,
remount root read-only, and either reboot or (from the first shell)
exec /sbin/init -s to follow the normal bootup to single mode (Be sure 
you
remounted root ro in this case or your init scripts will likely fail).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Init single and Serial console : How to ?
  2004-07-04  6:07 Milton Miller
@ 2004-07-04  8:44 ` Paul Rolland
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Rolland @ 2004-07-04  8:44 UTC (permalink / raw)
  To: 'Milton Miller'; +Cc: linux-kernel

Hi Milton,
> 
> Not quite single mode, but what I have done in similar situations is 
> boot with
> console=ttyS0 init=/bin/sh

Should do the trick. Single mode was good because it was not running
rl 3 init-scripts.
Not running any of them is good too :-)
The trick was to have the serial console/shell without having to
go thru the ioctlsave stuff.


Regards,
Paul


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Init single and Serial console : How to ?
  2004-07-04  5:09 Init single and Serial console : How to ? Paul Rolland
@ 2004-07-04 10:09 ` Bernd Eckenfels
  2004-07-04 10:32   ` Paul Rolland
  0 siblings, 1 reply; 8+ messages in thread
From: Bernd Eckenfels @ 2004-07-04 10:09 UTC (permalink / raw)
  To: linux-kernel

In article <200407040509.i6459iX21158@tag.witbe.net> you wrote:
>    ioctlsave is a small utility to create the Linux SysV init file
>    /etc/ioctl.save from a multiple user run level rather than from single
>    user mode. /etc/ioctl.save contains the terminal settings to be used in
>    single user mode.

this is only about terminal settings like flags  and line speed, it is not
related to presenting the login on the serial console. It is a good idea to
remove this file and set the baud rate on the boot command line.

You must configure /sbin/sulogin which is called from init to run on
/dev/console, then you will be fine. Also you should start a getty on
/dev/ttySx for multi user modes (see the serial console howto)

Greetings
Bernd
-- 
eckes privat - http://www.eckes.org/
Project Freefire - http://www.freefire.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Init single and Serial console : How to ?
  2004-07-04 10:09 ` Bernd Eckenfels
@ 2004-07-04 10:32   ` Paul Rolland
  2004-07-08  5:32     ` Paul Rolland
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Rolland @ 2004-07-04 10:32 UTC (permalink / raw)
  To: 'Bernd Eckenfels', linux-kernel

Hello,

> this is only about terminal settings like flags  and line 
> speed, it is not
> related to presenting the login on the serial console. It is 
> a good idea to
> remove this file and set the baud rate on the boot command line.
OK.
 
> You must configure /sbin/sulogin which is called from init to run on
> /dev/console, then you will be fine. Also you should start a getty on
OK, but remember that my problem is to find a way to access the machine
when I only have a serial console and it doesn't complete the "classical"
boot process because some init script at runlevel 3 is blocking...

This means that I can't go up to the "configure /sbin/sulogin", and need
a way to be given a serial prompt only by giving parameter at the LILO
prompt, considering that the kernel has already been configured for serial
console.

> /dev/ttySx for multi user modes (see the serial console howto)
This is already done.

Regards,
Paul


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Init single and Serial console : How to ?
  2004-07-04 10:32   ` Paul Rolland
@ 2004-07-08  5:32     ` Paul Rolland
  2004-07-08  7:44       ` Russell King
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Rolland @ 2004-07-08  5:32 UTC (permalink / raw)
  To: rol, 'Bernd Eckenfels', linux-kernel

Hello,

Got this one working :

LILO: linux init=/sbin/sulogin /dev/ttyS0

It finally asked me to enter root password, I did my maintenance, 
and then...
/sbin/reboot did nothing
leaving the shell (exit) said :
Attempting to kill init
Panic, will reboot in 30 seconds.
(or something like that), but it didn't restart, and I had to reboot
the machine...
Is this the expected behaviour ?

Regards,
Paul

Paul Rolland, rol(at)as2917.net
ex-AS2917 Network administrator and Peering Coordinator

--

Please no HTML, I'm not a browser - Pas d'HTML, je ne suis pas un navigateur

"Some people dream of success... while others wake up and work hard at it" 

  

> -----Message d'origine-----
> De : linux-kernel-owner@vger.kernel.org 
> [mailto:linux-kernel-owner@vger.kernel.org] De la part de Paul Rolland
> Envoyé : dimanche 4 juillet 2004 12:32
> À : 'Bernd Eckenfels'; linux-kernel@vger.kernel.org
> Objet : Re: Init single and Serial console : How to ?
> 
> Hello,
> 
> > this is only about terminal settings like flags  and line 
> > speed, it is not
> > related to presenting the login on the serial console. It is 
> > a good idea to
> > remove this file and set the baud rate on the boot command line.
> OK.
>  
> > You must configure /sbin/sulogin which is called from init to run on
> > /dev/console, then you will be fine. Also you should start 
> a getty on
> OK, but remember that my problem is to find a way to access 
> the machine
> when I only have a serial console and it doesn't complete the 
> "classical"
> boot process because some init script at runlevel 3 is blocking...
> 
> This means that I can't go up to the "configure 
> /sbin/sulogin", and need
> a way to be given a serial prompt only by giving parameter at the LILO
> prompt, considering that the kernel has already been 
> configured for serial
> console.
> 
> > /dev/ttySx for multi user modes (see the serial console howto)
> This is already done.
> 
> Regards,
> Paul
> 
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Init single and Serial console : How to ?
  2004-07-08  5:32     ` Paul Rolland
@ 2004-07-08  7:44       ` Russell King
  2004-07-09  6:28         ` Paul Rolland
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King @ 2004-07-08  7:44 UTC (permalink / raw)
  To: Paul Rolland; +Cc: 'Bernd Eckenfels', linux-kernel

On Thu, Jul 08, 2004 at 07:32:45AM +0200, Paul Rolland wrote:
> Got this one working :
> 
> LILO: linux init=/sbin/sulogin /dev/ttyS0
> 
> It finally asked me to enter root password, I did my maintenance, 
> and then...
> /sbin/reboot did nothing
> leaving the shell (exit) said :
> Attempting to kill init
> Panic, will reboot in 30 seconds.
> (or something like that), but it didn't restart, and I had to reboot
> the machine...
> Is this the expected behaviour ?

Yes, since you exited the process which was pretending to be the init
program.  Basically, whatever program is pretending to be init must
never exit or be killed off - it's special.

You probably wanted to do /sbin/reboot -f

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Init single and Serial console : How to ?
  2004-07-08  7:44       ` Russell King
@ 2004-07-09  6:28         ` Paul Rolland
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Rolland @ 2004-07-09  6:28 UTC (permalink / raw)
  To: 'Russell King'; +Cc: 'Bernd Eckenfels', linux-kernel

Hello,
> 
> Yes, since you exited the process which was pretending to be the init
> program.  Basically, whatever program is pretending to be init must
> never exit or be killed off - it's special.
> 
> You probably wanted to do /sbin/reboot -f
> 

Should have turn my tongue in my mouth, and removes my gloves before
touching the keyboard :)

Yes, that's exactly what was happening, and reboot -f is the way to
restart correctly the machine.

Thanks for fixing me, 
Regards,
Paul


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-07-09  6:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-04  5:09 Init single and Serial console : How to ? Paul Rolland
2004-07-04 10:09 ` Bernd Eckenfels
2004-07-04 10:32   ` Paul Rolland
2004-07-08  5:32     ` Paul Rolland
2004-07-08  7:44       ` Russell King
2004-07-09  6:28         ` Paul Rolland
  -- strict thread matches above, loose matches on Subject: below --
2004-07-04  6:07 Milton Miller
2004-07-04  8:44 ` Paul Rolland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox