Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 113187 - Unable to remove /sys errors during boot.
Summary: Unable to remove /sys errors during boot.
Status: RESOLVED DUPLICATE of bug 113684
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-21 11:01 UTC by Eric Work
Modified: 2005-12-27 13:16 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output from the various commans listed below. (output.txt,7.48 KB, text/plain)
2005-11-29 18:51 UTC, Eric Work
Details
boot.msg file (boot.msg,758 bytes, text/plain)
2005-11-29 20:40 UTC, Eric Work
Details
coreutils patch (rm-parent-verbose.patch,1.11 KB, patch)
2005-12-08 04:15 UTC, Daniel Drake (RETIRED)
Details | Diff
coreutils patch (rm-verbose-log.patch,1.42 KB, patch)
2005-12-11 03:41 UTC, Daniel Drake (RETIRED)
Details | Diff
rm log file after reboot (rm.log,103.45 KB, text/plain)
2005-12-11 10:33 UTC, Eric Work
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Work 2005-11-21 11:01:17 UTC
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
Comment 1 Danny van Dyk (RETIRED) gentoo-dev 2005-11-21 11:09:10 UTC
Sounds like a bug with baselayout... Assigning thus to azarah
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2005-11-21 11:11:03 UTC
Post your baselayout version (much more important than irrelevant info like
system-tools-backends). 
Comment 3 Eric Work 2005-11-21 12:43:48 UTC
Sorry I wasn't sure what to include or what packages/files are involved in
loading and unloading /sys.

baselayout-1.11.13-r1
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2005-11-28 01:40:53 UTC
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).
Comment 5 Eric Work 2005-11-28 01:45:10 UTC
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.
Comment 6 SpanKY gentoo-dev 2005-11-28 05:56:01 UTC
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
Comment 7 Eric Work 2005-11-29 18:51:06 UTC
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/*"
Comment 8 Eric Work 2005-11-29 18:54:03 UTC
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
Comment 9 SpanKY gentoo-dev 2005-11-29 19:51:49 UTC
oh, you have to emerge the showconsole package first ...
Comment 10 Eric Work 2005-11-29 20:40:49 UTC
Created attachment 73827 [details]
boot.msg file
Comment 11 Eric Work 2005-11-29 20:43:31 UTC
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?
Comment 12 SpanKY gentoo-dev 2005-11-29 20:57:14 UTC
do the errors show up in `dmesg` ?
Comment 13 Eric Work 2005-11-29 21:16:31 UTC
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.
Comment 14 SpanKY gentoo-dev 2005-11-29 22:16:36 UTC
do you use hotplug ?  is there something in /etc/hotplug/ that messes around
with /sys ?
Comment 15 Eric Work 2005-11-29 23:45:11 UTC
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
Comment 16 Eric Work 2005-11-30 20:02:25 UTC
I have upgraded to "baselayout-1.12.0_pre11-r3" and the problem is still there.
Comment 17 Daniel Drake (RETIRED) gentoo-dev 2005-12-08 04:15:20 UTC
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.
Comment 18 Eric Work 2005-12-10 13:26:39 UTC
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.
Comment 19 SpanKY gentoo-dev 2005-12-10 14:05:10 UTC
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
Comment 20 Eric Work 2005-12-11 00:41:44 UTC
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.
Comment 21 Daniel Drake (RETIRED) gentoo-dev 2005-12-11 03:41:23 UTC
Created attachment 74483 [details, diff]
coreutils patch

this logs to /tmp/rm.log
Comment 22 Eric Work 2005-12-11 10:33:23 UTC
Created attachment 74514 [details]
rm log file after reboot
Comment 23 Eric Work 2005-12-11 10:36:29 UTC
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.
Comment 24 Bill Binder 2005-12-20 00:37:21 UTC
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.
Comment 25 simone 2005-12-27 05:20:36 UTC
> 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
Comment 26 simone 2005-12-27 05:24:58 UTC
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
Comment 27 Tim Yamin (RETIRED) gentoo-dev 2005-12-27 13:16:52 UTC

*** This bug has been marked as a duplicate of 113684 ***