Bug 450643

Summary: yast2 bootloader aborts when /proc is not mounted
Product: [openSUSE] openSUSE 11.1 Reporter: Andi N Kleen <andi-nbz>
Component: YaST2Assignee: Jiri Srain <jsrain>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium    
Version: RC 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andi N Kleen 2008-12-01 21:11:39 UTC
When /proc is not mounted yast2 bootloader aborts after reading /proc/meminfo
It should ignore that error instead.

No no yast2 logs, but it's trivial to reproduce.

I ran into that while trying to use it inside the rescue cd, but chrooted
Comment 1 Josef Reidinger 2008-12-02 12:10:11 UTC
Unmounted /proc is fatal error and really not expected. Lot of program fail if it doesn't have it. If you want work in chroot you must bind it.
so
mount /dev/... /chroot
mount --bind /proc /chroot/proc
mount --bind /dev /chroot/dev
mount --bind /sys /chroot/sys
chroot /chroot

this is expected and without /proc a lot of programs doesn't work.
Comment 2 Andi N Kleen 2008-12-02 13:35:35 UTC
Yes I know about mount --bind. No I don't type in all of this on
a rescue cd session.

Sorry, abort() on missing /proc is not expected and just wrong.
At least give a proper error message like the proc utils.

But really aborting on missing /proc/meminfo (or any missing
file) is just bad programming and there's no excuse at all for doing that.

Also not reading the available memory is clearly not a fatal
error for yast. Just return 128MB in this case.
Comment 3 Josef Reidinger 2008-12-02 13:48:17 UTC
Hmm, perl-Bootloader nor yast2-bootloader doesn't read directly /proc/meminfo. So problem is in yast, here is direct usage of /proc/meminfo:

gtk/integrate/YaST2.call:MEM_TOTAL=`awk '/^MemTotal:/{ print $2 }' /proc/meminfo`
installation/startup/YaST2.call:MEM_TOTAL=`awk '/^MemTotal:/{ print $2 }' /proc/meminfo`
installation/startup/First-Stage/F08-logging:    USE=`awk '/^MemFree:/{ n=2 ; printf "%d\n", $n/3 }' /proc/meminfo`
repair/data/filenames:/proc/meminfo
yast2/library/agents/proc_meminfo.scr:  (`File("/proc/meminfo")),       // real file name

So I reassign it to yast-maintainers and also decrease severity to low, as this is not much expected scenario without /proc.
Comment 4 Michael Andres 2008-12-03 16:18:37 UTC
But the problem does not seem to be directly reading /proc/meminfo. Neither YaST2.call nor proc_meminfo.scr abort if the file is not there. Scr read will just return an empty map. YaST2.call will disable qt/gtk if there is to less memory.

If bootloader has to abort due to missing input data, maybe there is a message to improve? 

Otherwise we should close this unless someone is able to reproduce it, or provides some log that reveals what's actually happening.
Comment 5 Michael Andres 2008-12-09 16:01:49 UTC
Forget about my previous comment. Given that without /proc not just meminfo, but also partitions, mounts, devices and various others are not available, we could also consider not to start at all.

Josef is right, there's proably not much working without /proc.

We could test for /proc in the startup script, and if it's missing print  Josef's advice from comment #1 and exit.
Comment 6 Jiri Srain 2009-04-20 14:17:08 UTC
I added checks that those three directories mentioned in comment #1 are non-empty and YaST refuses to start if they are (with reasonable message).

Since chroot cannot be really detected, it prints a more generic message.