OpenVZ Forum


Home » General » Support » *SOLVED* Console Messages?
*SOLVED* Console Messages? [message #9449] Wed, 03 January 2007 21:46 Go to next message
mperkel is currently offline  mperkel
Messages: 253
Registered: December 2006
Senior Member
Is there any way to start up a VE and sort of watch it boot the way you would by watching the console of a real server? I need to see what's happening as part of troubleshooting to see if and where it hangs.


[Updated on: Tue, 09 January 2007 06:52] by Moderator

Report message to a moderator

Re: Console Messages? [message #9452 is a reply to message #9449] Thu, 04 January 2007 00:23 Go to previous messageGo to next message
sspt is currently offline  sspt
Messages: 100
Registered: August 2006
Location: Portugal
Senior Member
You can try Netconsole
http://wiki.openvz.org/Remote_console_setup

If it don't work you may want a KVM over IP


http://static.openvz.org/userbars/openvz-user.png
Re: Console Messages? [message #9464 is a reply to message #9449] Thu, 04 January 2007 14:50 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

The way to go here is to replace /sbin/init binary inside a VE with your own script, for example like this:

mv /sbin/init /sbin/init.real
cat << EOF > /sbin/init
exec /sbin/init.real > /tmp/init.log 2>&1
EOF
chmod 755 /sbin/init


When (re)start a VE and watch its /tmp/init.log file (for example: tail -f /vz/root/NNN/tmp/init.log. When you have finished your debugging, do not forget to move the real init binary back.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Console Messages? [message #9939 is a reply to message #9464] Wed, 31 January 2007 05:05 Go to previous messageGo to next message
seyko is currently offline  seyko
Messages: 2
Registered: January 2007
Junior Member
Is this example work? There is only an empty file for me.

May be there is something like VE /dev/console grabber?
Or an option to "vzctl start" to connect to this console on
start?


Re: Console Messages? [message #9942 is a reply to message #9939] Wed, 31 January 2007 09:13 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

For me this example doesn't work either,
so I use the following script instead /sbin/init:

#! /bin/sh
export CONSOLE=/tmp/init.log
exec /sbin/init.real $*


/sbin/init.real is the copy of original /sbin/init

Note, that /tmp/init.log resides in VE, and is overwritten
each(!) time you start VE.

HTH,
Vasily.
Re: Console Messages? [message #10093 is a reply to message #9942] Thu, 08 February 2007 07:21 Go to previous messageGo to next message
stoffell is currently offline  stoffell
Messages: 16
Registered: February 2007
Location: Belgium
Junior Member
I tested both examples, but none works.
I don't even get the file...

I'm using debian (HN = etch and the VE = sarge), is there anything else I can test to get the logging to file to work?

Re: Console Messages? [message #10096 is a reply to message #10093] Thu, 08 February 2007 07:42 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

I've checked debian sarge template and indeed my method doesn't work there! Rolling Eyes For some reasons init in Debian doesn't take CONSOLE variable into account...

Well, there is one more method, which is more rude. Just replace /dev/console device in VE by usual text file. After VE start you can see logs in this file.

Don't forget to return everything back, when you finish debugging!

HTH,
Vasily.
Re: Console Messages? [message #10098 is a reply to message #10096] Thu, 08 February 2007 08:35 Go to previous messageGo to next message
stoffell is currently offline  stoffell
Messages: 16
Registered: February 2007
Location: Belgium
Junior Member
Thanks, I'll try that! I'll also try to get some more debian info, there has to be a way to do it the 'non-rude' way Smile

I'll post if I manage to get around it.

Thanks!

cheers

Re: Console Messages? [message #10357 is a reply to message #10098] Thu, 15 February 2007 19:16 Go to previous messageGo to next message
stoffell is currently offline  stoffell
Messages: 16
Registered: February 2007
Location: Belgium
Junior Member
I have only been able to do this the "rude" way on debian.
That is:
rm /dev/console
touch /dev/console


Now, that's a way, it's not clean, but it's okay for troubleshooting!

Now, on a RedHat 7.2 installation (I imported it to a VE, which is running on Debian Etch) this does not work. There's no /dev/console.

Neither the other methods work. The problem is, the RH 7.2 VE does not shutdown correctly and thus gets stopped after 2 minutes. (default timeout)

Any ideas on how to investigate this? (must be something on shutdown that causes this..)

cheers!
Re: Console Messages? [message #10361 is a reply to message #10357] Thu, 15 February 2007 21:03 Go to previous message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Please, create a separate thread for discussion of this problem...
Previous Topic: *SOLVED* 32bit vs. x86-64bit ?
Next Topic: *UPDATED* networking Problem venet / veth
Goto Forum:
  


Current Time: Tue May 21 21:01:38 GMT 2024

Total time taken to generate the page: 0.01640 seconds