Skip to contentSkip to conversation

Init single and Serial console : How to ?

DISCUSSION Paul Rolland 3 participants 6 messages Jul 4, 2004 – Jul 9, 2004

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 4 lines · In article <[email protected]> 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

Signature · 2 lines
eckes privat - http://www.eckes.org/
Project Freefire - http://www.freefire.org/
#2 lore raw

Hello,

Quoted 5 lines

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.

Quoted 2 lines

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.

Quoted 1 line

/dev/ttySx for multi user modes (see the serial console howto)

This is already done.

Regards,
Paul

#3 lore raw

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"

Quoted 46 lines

-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De la part de Paul Rolland Envoyé : dimanche 4 juillet 2004 12:32
À : 'Bernd Eckenfels'; [email protected]
Objet : Re: Init single and Serial console : How to ?

Hello,

Quoted 5 lines

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.

Quoted 2 lines

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.

Quoted 1 line

/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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 4 lines · Paul Rolland

Got this one working :

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

Quoted 9 lines

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

Signature · 4 lines
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
#5 lore raw

Hello,

Quoted 7 lines

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