LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-04-2014, 07:15 AM   #1
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Rep: Reputation: 21
Console access during the boot process


Hello experts,

I'm faced with a challenge, hopefully one of you is able to help me with. From time to time, when booting a Linux machine here at work, one of the boot processes hangs leaving the machine inaccessable. A reboot is basically the only option we have then.

What we'd really like is there is a way so we can access the machine in it's hanging state so we can see what's causing it and thus resolving the issue. The hanging process is early in runlevel 3.

For the complete configuration, these are all virtual machines running WindRiver Linux 4.2 on a Red Hat Enterprise Virtualization platform.

Any help will be greatly appriciated.
Louis
 
Old 07-04-2014, 10:41 AM   #2
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Rep: Reputation: 28
doesnt the boot.log have that info? have you checked that?
 
Old 07-04-2014, 11:24 AM   #3
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by baldur_1 View Post
doesnt the boot.log have that info? have you checked that?
Well, not real time info on running processes etc. Just to make things more clear, it's typically one of the init scripts that hangs, and just blocks the whole machine from continuing the boot process. The machine in itself is working. We'd like to debug it in the state it's in.
 
Old 07-04-2014, 11:27 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Unofrtunately, there often isn't a good way to get to a shell early in the boot process since the virtual consoles aren't brought up until getty, mingetty, or the like are spawned by init, usually at or near the end. The better option would be to figure out what service is hanging. If possible, you should put a timeout in the init script that starts it that will cause it to exit if the service has not started. This page describes the basics of how to do this within the init script. If the script is hitting some error condition though, it might be best just to test on that directly.
 
1 members found this post helpful.
Old 07-04-2014, 12:00 PM   #5
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by btmiller View Post
Unofrtunately, there often isn't a good way to get to a shell early in the boot process since the virtual consoles aren't brought up until getty, mingetty, or the like are spawned by init, usually at or near the end. The better option would be to figure out what service is hanging. If possible, you should put a timeout in the init script that starts it that will cause it to exit if the service has not started. This page describes the basics of how to do this within the init script. If the script is hitting some error condition though, it might be best just to test on that directly.
Thanks, I'll have a look at the handling timeouts in the init script. That may be quite useful anyway.

Having said that, would it be possible to make init spawn getty etc as one of the first things? Like that we could have the desired console access.
 
Old 07-05-2014, 10:49 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
In theory it should be possible, but I'll admit that I don't know how to do it. On older init systems (pre upstart/systemd/init-flavor-of-the-week) this was controlled by lines in /etc/inittab, so I'd start there. Otherwise, consult the documentation for the init system that you happen to be using.
 
1 members found this post helpful.
Old 07-05-2014, 12:16 PM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
you COULD edit the boot entry to add init=/bin/bash to the kernel options, thiss will dump you to a bare minimum root shell (with the volumes mounted read only), from there you can run
Code:
 mount -oremount rw /
to mount the / partition read/write and temporarily disable the buggy init script, or at least read the log files to see what's going wrong with the init script and modify it as necessary

note, doing this will leave the machine in a bare-bones state with no services such as networking running

Last edited by frieza; 07-05-2014 at 12:41 PM. Reason: minimum, not minimu
 
1 members found this post helpful.
Old 07-07-2014, 04:56 AM   #8
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by frieza View Post
you COULD edit the boot entry to add init=/bin/bash to the kernel options, thiss will dump you to a bare minimum root shell (with the volumes mounted read only), from there you can run
Code:
 mount -oremount rw /
to mount the / partition read/write and temporarily disable the buggy init script, or at least read the log files to see what's going wrong with the init script and modify it as necessary

note, doing this will leave the machine in a bare-bones state with no services such as networking running
Hi,

Thanks for the tip. I tried it, but I'm afraid this is not what I'm looking for. The machine will drop into a shell straight away. But I'm looking for a possibility to get console access the moment the script is haning. So that's somewhere in runlevel 3.
 
  


Reply



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
Solaris Interupt Boot Process to login at console mccartjd Solaris / OpenSolaris 2 01-16-2012 09:44 PM
Can't access console after boot 13.37 grond Slackware - Installation 2 07-05-2011 03:43 PM
[SOLVED] redirect system console to a virtual terminal or a file but after boot process agambier Linux - Kernel 1 03-08-2011 03:24 AM
Mandrake 9.2's boot process entirely done in console mode before loading in X mode... mishmash Mandriva 6 02-17-2004 09:19 PM

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

All times are GMT -5. The time now is 10:00 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
Open Source Consulting | Domain Registration