xrmx / bootchart

merge of bootchart-collector and pybootchartgui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

enaut opened this issue · comments

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

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

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...

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

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

Any comments?

Why is there a difference between initrd and normal boot?

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.

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

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:

  • Is this test neccessary for initrd users?
  • I so how to test properly for the initrd?
  • maybe one could add a function to the binary as done for sleep? (I noticed there is already a check for initrd in the binary using some info from /proc/mounts but I had not benn able to use this so far as I'm not really in the code)

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

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 :)

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...

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.

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.

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

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 :)