halt.sh is freezing on function "unmounting filesystems ..." from what I have figured out so far the command: for x in $(awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts |sort -r) is choking on the part of the regex that sys " \/ ". It just hangs forever. Removing that part lets the awk finish but then "/" gets retuned to the umount function as part of the loop. That sounds like a bad thing. I'm using baselayout 1.8.5.3 and gawk-3.1.1-r1 on an AMD IBM Aptiva 2158-530. Bug exists with or without devfs running. I've marked this as a major bug because without commenting out these lines, I can't shutdown or reboot normally. I'll attach a copy of my /proc/mounts and the halt.sh
Created attachment 6311 [details] The halt.sh script that freezed the system
Created attachment 6312 [details] The return of "cat /proc/mounts"
Please include /etc/fstab.
If I run from command line: -------------------------- nosferatu mozilla # awk '!/(^#|^[[:space:]]*$|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print $2}' /tmp/mounts /mnt/floppy nosferatu mozilla # awk '!/(^#|^[[:space:]]*$|proc|devfs|tmpfs|^none|^\/dev\/root)/ {print $2}' /tmp/mounts / /mnt/floppy nosferatu mozilla # --------------------- Which is wrong, as then / will be unmounted premacurely ... Please include the same info as above.
Created attachment 6502 [details] my /etc/fstab here is my fstab. sorry it took so long to get back to you on this.
No problem. This is a weird one ... does your gawk/awk work ... can you run them from command line ? Also, did you try a vanilla kernel yet ?
I'm already running a vanilla-sources kernel and awk does work from the command line,as I stated in my original post, it just chokes on the part of the awk command that describes the root directory.
Err, problem is it is working fine for thousands of other users. Also, There is nothing wrong with that regex (syntax wise) ...
Please paste output of: # emerge info
Created attachment 6531 [details] Output of emerge info
Change your CFLAGS and CXXFLAGS to: CFLAGS="-march=k6-2 -O2 -pipe" CXXFLAGS="-march=k6-2 -O2 -pipe" Remerge gawk, and see if that fixes it.
how can i do that from the command line without messing with my make.conf?
# CFLAGS="-march=k6-2 -O2 -pipe" CXXFLAGS="-march=k6-2 -O2 -pipe" emerge gawk
And ?
Sorry for the delay. I remerged gawk with -O only and it runs OK, but ... The plot thickens. If i run what is in the halt.sh script: awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts |sort -r It outputs: / if I take out the space at the end of the " \/ " it outputs nothing. Which is the correct answer. So ... it works almost. Any other ideas/suggestions? Can that trailing space come out? Dave Yorke
nosferatu root # awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts |sort -r /space/gentoo/usr/portage /space /home nosferatu root # It should actually list all local mounts except rootfs (/), and devfsd, proc, etc .... Maybe try it like so: # awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root|[[:space:]]\/[[:space:]])/ {print $2}' /proc/mounts |sort -r
In my case, with my system now anyway, I only have devfs, tmpfs,rootfs and proc. So it should come back blank. Btw, you' sugggested code: # awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root|[[:space:]]\/[[:space:]])/ {print $2}' /proc/mounts |sort -r Returned nothing as it was supposed to. Excellent. <<Twiddle fingers ala Monty Burns>> One question though, if the awk returns nothing will the for loop skip itself because x = 0 or will it crash? I'm only asking because I have very little experience in shell programming. David Yorke
It should not run the code in the for loop. Great, ill tweak the code in halt.sh on cvs.
Try masked baselayout-1.8.5.6 please.
Open if still problems with 1.8.5.6.