After upgrading to gentoo-sources-2.6.14-r2 kernel on amd64 I started seeing error messages about unable to remove /sys/* permission denied. System still boots normally and all hardware works after rebuilding the eeded modules. After a couple reboots everything still works fine but the error messages remain. Reproducible: Always Steps to Reproduce: 1. Reboot 2. Watch screen during boot-up Actual Results: I see error messages pertaining to removing file in /sys. Expected Results: It should have not tried to remove files in /sys. Linux erwin 2.6.14-gentoo-r2 #1 SMP PREEMPT Tue Nov 15 17:13:31 PST 2005 x86_64 AMD Opteron(tm) Processor 242 AuthenticAMD GNU/Linux sysvinit-2.86 system-tools-backends-1.2.0 sysfsutils-1.3.0 gentoo-sources-2.6.14-r2
Sounds like a bug with baselayout... Assigning thus to azarah
Post your baselayout version (much more important than irrelevant info like system-tools-backends).
Sorry I wasn't sure what to include or what packages/files are involved in loading and unloading /sys. baselayout-1.11.13-r1
We do not try to remove /sys in baselayout, so its either kernel related if an earlier kernel fixes it, or some other script or custom script. Not sure if it can be hotplug/udev related (highly unlikely i think).
It first occured after upgrading from 2.6.13 to 2.6.14-r2 (gentoo-sources). I'm not sure what the the problem is and I can't seem to find anything unusual after doing some greping and manual searching though /etc/init.d.
you still havent posted `emerge info` like the bug report page told you to also, post the output of `rc-update -s`, any modules you have loaded automatically at boot, and the output of `grep /sys /etc/init.d/*` it'd also help if you posted actual error messages rather than just describing them ... if you're unable to capture the output yourself, try setting RC_BOOTLOG to yes in /etc/conf.d/rc and post the file /var/log/boot.msg
Created attachment 73823 [details] Output from the various commans listed below. output from "emerge info" output from "rc-update -s" output from "grep /sys /etc/init.d/*"
I put the line mentioned in /etc/conf.d/rc but no file was created during a reboot. What I am seeing is the following error message but for each file in /sys. These are prior to /sys being mounted, or at least where it is mentioned with the green star during boot. rm: cannot remove `/sys/power/state': Operation not permitted
oh, you have to emerge the showconsole package first ...
Created attachment 73827 [details] boot.msg file
The problem occurs before init is even loaded (before the init 2.86 loaded message) so does that mean it has nothing to do with start-up scripts. Is something maybe happening when file systems are first being mounted?
do the errors show up in `dmesg` ?
No, the problem is it goes to stderr much like the normal output of rm when an error occurs. I'm not sure where to look, but something besides an init script is trying to perform an "rm -rf /sys". You can produce the same output as root running "rm -rf /sys". It goes by too fast to see what is the last normal step that occurs before the error messages appear.
do you use hotplug ? is there something in /etc/hotplug/ that messes around with /sys ?
I don't see anything unusual in /etc/hotplug but that might be a likely source. I pasted some additional info below that might help. I can also try updating coldplug/hotplug and see if that makes a difference. hotplug-base-20040401 hotplug-20040923-r1 coldplug-20040920 erwin hotplug #grep /sys /etc/hotplug/* /etc/hotplug/firmware.agent:# DEVPATH=%s [in 2.5 kernels, /sys/$DEVPATH] /etc/hotplug/hotplug.functions:if [ -f /etc/sysconfig/hotplug ]; then /etc/hotplug/hotplug.functions: . /etc/sysconfig/hotplug /etc/hotplug/pci.rc: if [ -d /sys/bus ]; then /etc/hotplug/pci.rc: if [ -d /sys/bus/pci/devices/ ]; then /etc/hotplug/pci.rc: cd /sys/bus/pci/devices/ /etc/hotplug/pnp.rc:if [ "$(echo /sys/bus/pnp/devices/*)" = "/sys/bus/pnp/devices/*" ] /etc/hotplug/pnp.rc: cd /sys/bus/pnp/devices/ /etc/hotplug/scsi.agent: if [ ! -d /sys/$DEVPATH ]; then /etc/hotplug/scsi.agent: TYPE_ATTR=/sys$DEVPATH/type /etc/hotplug/usb.agent:# DEVPATH=%s [in 2.5 kernels, /sys/$DEVPATH] /etc/hotplug/usb.agent:if [ -f /etc/sysconfig/usb ]; then /etc/hotplug/usb.agent: . /etc/sysconfig/usb /etc/hotplug/usb.agent:# "new" events have nonzero /sys/$DEVPATH/bInterfaceNumber /etc/hotplug/usb.agent:SYSFS=/sys /etc/hotplug/usb.rc:if [ -f /etc/sysconfig/usb ]; then /etc/hotplug/usb.rc: . /etc/sysconfig/usb /etc/hotplug/usb.rc: # FIXME on 2.5, /sys/bus/usb/devices/* gives all of the /etc/hotplug/usb.rc: if [ -d /sys/bus ]; then /etc/hotplug/usb.rc: if [ -d /sys/bus/usb/devices ]; then /etc/hotplug/usb.rc: cd /sys/bus/usb/devices /etc/hotplug/usb.rc: for device in /sys/bus/usb/devices/[0-9]*; do /etc/hotplug/usb.rc: DEVPATH=${devlink#/sys} /etc/hotplug/usb.rc: if [ -d /sys/bus/usb ]; then /etc/hotplug/usb.rc: ls -1 /sys/bus/usb/drivers /etc/hotplug/usb.rc: if [ -f /proc/sys/kernel/hotplug ]; then
I have upgraded to "baselayout-1.12.0_pre11-r3" and the problem is still there.
Created attachment 74292 [details, diff] coreutils patch Please apply this patch to coreutils. It will make "rm" print out some info about its parent process every time it is ran. This should provide some useful insight. If the messages go off the screen to quickly and they aren't logged, let me know, and we can make rm log this info to a file instead.
I think a logging rm would be easier as it goes by pretty quick. Also could you provide a modified ebuild for coreutils. I'm not sure how to apply this patch as the coreutils in portage has a bunch of other patches which are also applied.
just run `emerge coreutils` and then after you see the '>>> Source unpacked.' line, hit CTRL+Z to pause the package, go into the coreutils build dir in /var/tmp/portage, and apply the patch yourself
I tried the rm patch but everything goes by too fast. I tried taking a picture with my digital camera but my LCD is too slow and the letters look messed up. Could you provide a logging version, which would have to include what file is being deleted. I can then attach the log.
Created attachment 74483 [details, diff] coreutils patch this logs to /tmp/rm.log
Created attachment 74514 [details] rm log file after reboot
I attached the log file but I dont see anything in there about /sys/. At the point were this happens the system has not yet been mounted read/write so that is likely why nothing shows up. Also with the vebose patch I applied before I rebooted and watch the screen again and none of the verbose messages showed up, only during system shutdown did most of them appear. Is there some sort of reset mechanism for /sys. It really looks to be trying to clear the mount point or something like that.
The problem started happening for me when I rebuilt my kernel, gentoo-sources-2.6.11-r8, following the recent gcc 3.4.4 upgrade. I haven't rebuilt the kernel since sometime around June/July - gcc has changed - genkernel has changed since then. I haven't got round to installing udev yet.
> Expected Results: > It should have not tried to remove files in /sys. > > Linux erwin 2.6.14-gentoo-r2 #1 SMP PREEMPT Tue Nov 15 17:13:31 PST 2005 x86_64 > AMD Opteron(tm) Processor 242 AuthenticAMD GNU/Linux > > sysvinit-2.86 > system-tools-backends-1.2.0 > sysfsutils-1.3.0 > gentoo-sources-2.6.14-r2
I think it is related to genkernel and initramfs creation... If i reboot without initramfs in my grub configuration i get no errors! Grub conf: title Gentoo, kernel 2.6.14-r5 root (hd0,2) kernel /boot/kernel-genkernel-x86-2.6.14-gentoo-r5 root=/dev/ram0 real_root=/dev/hda3 init=/linuxrc ramdisk_size=8192 video=vesafb:1024x768-32@75,mtrr,ywrap splash=silent,fadein,theme:miosplash CONSOLE=/dev/tty1 udev quiet initrd /boot/initramfs-genkernel-x86-2.6.14-gentoo-r5 boot
*** This bug has been marked as a duplicate of 113684 ***