xrmx / bootchart

merge of bootchart-collector and pybootchartgui
GNU General Public License v2.0
233 stars 88 forks source link

When I boot with bootchart I have to stop it manually? #13

Closed enaut closed 13 years ago

enaut commented 13 years ago

Hi, I compiled and installed your bootchart and the graphics it produces are very neat :D One thing though! It fails to stop automatically. I checked the start script. There are several programs listed as "stopping condition" one of them is gnome-terminal I added gdm and I have other programs from that list started. But bootchart stops only after issuing /sbin/bootchartd stop. What could be wrong? how does it scan for the processes?

best enaut

xrmx commented 13 years ago

hello, could please tell us which bootchart version and which distribution are you using?

enaut commented 13 years ago

Ok, Bootchart version is recent git ( f1130f3 ) Distribution is Gentoo but quite customized. The Thing I'm trying to visualize is systemd init system(in case you heard of it).

One think I can think of is: does bootchart rely on some init system runlevel variables? because it might be that systemd does not set those...

enaut commented 13 years ago

Ok I found the evil pice of code :D I'm not running on initrd but my /dev/ is generated using udev. So /dev/random does not exist in that early stage of boot.

So this test gives some false positives: if [ ! -e /dev/random ]; then IN_INITRD="yes"

if I remove that test it works just great for me! However I don't know about initrd setups. what is this distiction for? I can't find the reason for this if!

I fixed it for me in my fork enaut/bootchart@ff11038 enaut/bootchart@5488c804

enaut commented 13 years ago

Mhm I thought about it again... maybe a check for .linuxrc would be more apropriate?

enaut commented 13 years ago

Any comments?

Why is there a difference between initrd and normal boot?

xrmx commented 13 years ago

Please have a little bit of patience :) I have no clue about that code and no time to take a look at it at the moment.

enaut commented 13 years ago

ok so I will dive deeper into the code... and Try to find the sollution myself :)

enaut commented 13 years ago

I have currently no time to investigate this deeper. So here again my summary:

In the bootchartd script there is an "if" testing if in initrd. To do so it tests if the file /dev/random exists. However on modern kernels with modern distributions /dev is a tmpfs which is mounted only after the bootchartscript runs. So this test gives a false positive. For me this issue is solved if I remove the If completely. However I have no clue what this does to initrd users. That's why I tried to find a proper sollution for this test.

So open Questions so far:

Thats it so far I'll just use my "fixed/hacked" version until someone fixes it or I have more time to fix it myself. And sorry xrmx I didn't mean to offend you! I just thought that might be a simple thing for you :D best enaut

xrmx commented 13 years ago

No offense :) My doubt is if the IN_INITRD is needed only for initrd or for initramfs too? in the first case we can just check for [ -x /linuxrc ] otherwise i don't know :)

enaut commented 13 years ago

Thats what I thought too but I don't really like the Idea to check for a file... But for initramfs I think we could check for /init as its the same and usually not present on non initrd/ramfs systems... But as already said I don't really like the Idea of checking for a File I'd rather parse /proc/mountinfo or something like that... but the problem there is that this stuff is too complex for my tight schedule so far...

xrmx commented 13 years ago

I've pushed what i consider the minimal fix which is checking for /init or /linbuxrc being available. Please check that it is working fine for your case and if it is feel free to close the issue. Sorry for taking so long.

enaut commented 13 years ago

Thanks a lot should work unfortunately I somewhat crashed my systemd system... But I'll test this as soon as it's fully up and running again.

xrmx commented 13 years ago

Systemd is known to work with bootchart2 after Harald fixes. Closing this.

enaut commented 13 years ago

Just to confirm it here! It runs just fine with my newly setup exherbo (gentoo like distro with nativ systemd) I had to replace pidof with pgrep though!

and many thanks for solving this :)