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.)
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