Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 217082
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Chris Gianelloni (RETIRED) <wolf31o2@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Arthur Hagen <art-gt@broomstick.com>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 217082 depends on: Show dependency tree
Bug 217082 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-04-10 03:23 0000
dnetc reports an error on startup:

/etc/init.d/dnetc: line 45: /sys/kernel/uids/104/cpu_share: No such file or
directory

Previous versions do not have this error.

The relevant lines in /etc/init.d/dnetc read:

  # fair group cpu scheduler
  [ -d /sys/kernel/uids/ ] && echo 2 > \
    /sys/kernel/uids/$(grep -w dnetc /etc/passwd | cut -d: -f3)/cpu_share

In this case the file /sys/kernel/uids/104/cpu_share exists:

# ls -Zd /sys /sys/kernel /sys/kernel/uids /sys/kernel/uids/104
/sys/kernel/uids/104/cpu_share
drwxr-xr-x  root root system_u:object_r:sysfs_t  /sys
drwxr-xr-x  root root system_u:object_r:sysfs_t  /sys/kernel
drwxr-xr-x  root root system_u:object_r:sysfs_t  /sys/kernel/uids
drwxr-xr-x  root root system_u:object_r:sysfs_t  /sys/kernel/uids/104
-rw-r--r--  root root system_u:object_r:sysfs_t  /sys/kernel/uids/104/cpu_share


Reproducible: Always




The problem appears to be that when no other dnetc processes exist, the
/sys/kernel/uids/{UID} directory doesn't exist either.

Suggested quick fix:

45,46c45,47
<       [ -d /sys/kernel/uids/ ] && echo 2 > \
<               /sys/kernel/uids/$(grep -w dnetc /etc/passwd | cut -d:
-f3)/cpu_share
---
>       uidpath="/sys/kernel/uids/`id -u dnetc`"
>       [ -d $uidpath ] && echo 2 >$uidpath
>       unset uidpath

(Apropos, the proposed fix also fixeds another bug:  grepping /etc/passwd is
wrong, because the actual user ID might be obtained through NIS or LDAP no
matter what the passwd entry states.  "id" is in coreutils, so no extra
dependencies would be needed.)

------- Comment #1 From Arthur Hagen 2008-04-10 03:24:36 0000 -------
Err.  The correct patch is:

45,46c45,47
<       [ -d /sys/kernel/uids/ ] && echo 2 > \
<               /sys/kernel/uids/$(grep -w dnetc /etc/passwd | cut -d:
-f3)/cpu_share
---
>       uidpath="/sys/kernel/uids/`id -u dnetc`"
>       [ -d $uidpath ] && echo 2 >$uidpath/cpu_share
>       unset uidpath

------- Comment #2 From Chris Gianelloni (RETIRED) 2008-04-10 05:42:49 0000 -------
Oops... It looked good, anyway... hehe

I've fixed this in CVS now.  Thanks...

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug