Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Ubuntu x64 machine on a OpenVZ VPS account on a QuadCore processor with 1GB/2GB(burst). A few days ago I've managed to successfully update it to 11.10 Oneiric Ocelot. There's only one problem: my "init" process (PID = 1) is at 100% CPU usage, keeping one core 99.5% of the time at full throttle.

Is there any solution to stop the strange init's behavior? Can I trace what happens behind that init process to find out what makes it spike so high?

share|improve this question
    
Same for me. Unfortunately after setting log-priority to info or debug there's no additional info in /var/log/syslog or messages. –  user28603 Oct 18 '11 at 10:22

5 Answers 5

Unfortunately, because upstart makes heavy use of ptrace() for its 'expect fork' capabilities, it is really hard if not impossible to strace or attach to it w/ gdb most of the time.

However, you can turn on verbose logging.

initctl log-priority info

If you want even more stuff

initctl log-priority debug

This may at least give some clue as to what it is doing to use up all those CPU cycles.

share|improve this answer

It looks like this is a known bug in 11.10:

https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/880049

A patch has been submitted:

https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/880049/+attachment/2567049/+files/no_dev_console.patch

EDIT: Okay, the patch seems to work, but I modified it a bit.

Adding this:

    if (system_setup_console (CONSOLE_NONE, (! restart)) < 0)
        nih_free (nih_error_get ());

to init/main.c after:

    if (system_setup_console (CONSOLE_OUTPUT, (! restart)) < 0)
        nih_free (nih_error_get ());

works for me, insofar as the 100% cpu issue is gone, but the devs say it's not a proper fix.

share|improve this answer

The problem is that init requires access to /dev/console, which does not exist in an OpenVZ virtual machine.

If you have access to the physical machine, you can create the /dev/console device, by granting access to the physical device:

vzctl set 105 --devices c:5:1:rw --save

Replace 105 with the number of your virtual server. I had the same issue, and this solved the problem without having to compile a patched init.

share|improve this answer

upstart fix released by James Hewitt (2011-11-24)

https://code.launchpad.net/~jammy/+archive/upstart.fix-880049

#add-apt-repository ppa:jammy/upstart.fix-880049
#apt-get update
#apt-get upgrade
#reboot

init after reboot 0.0%

share|improve this answer

From Bellum PLC Forum - Ubuntu 11.10 init 100% cpu usage bug:

I noticed an CPU usage issue with init due to upstart, Which was eating 99% ram constantly. and i decided to find working fix. This is a bug which has been confirmed by Ubuntu but below is a simple quick fix patch which should work completely for all.

Firstly Open up SSH and add the following PPA
add-apt-repository ppa:jammy/upstart.fix-880049
Hit enter and Enter again.

If It says command not found, Issue this command first
apt-get install python-software-properties
Then
apt-get update && apt-get upgrade

share|improve this answer
    
I've added it to your question, you can use the "edit" button to add these details in the future :) –  Marco Ceppi Feb 3 '12 at 3:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.