7

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?

1
  • 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, 2011 at 10:22

5 Answers 5

7

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

2
  • I've added it to your question, you can use the "edit" button to add these details in the future :) Feb 3, 2012 at 3:50
  • 1
    I know this is old, but PPA does not work anymore Cannot add PPA: 'ppa:jammy/upstart.fix-880049'. Please check that the PPA name or format is correct.
    – Redithion
    Apr 21, 2017 at 12:58
4

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.

0

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.

-1

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.

-2

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%

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .